Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ArrayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __unset($name) {
* @param string $value
* @ignore
*/
public function offsetSet($offset, $value)
public function offsetSet(mixed $offset, mixed $value): void
{

if (is_callable([$this, 'set' . $offset])) {
Expand All @@ -58,7 +58,7 @@ public function offsetSet($offset, $value)
* @return bool
* @ignore
*/
public function offsetExists($offset)
public function offsetExists(mixed $offset): bool
{
return is_callable([$this, 'get' . $offset]) ||
is_callable([$this, 'set' . $offset]) ||
Expand All @@ -69,7 +69,7 @@ public function offsetExists($offset)
* @param string $offset
* @ignore
*/
public function offsetUnset($offset)
public function offsetUnset(mixed $offset): void
{

if (is_callable([$this, 'set' . $offset])) {
Expand All @@ -83,7 +83,7 @@ public function offsetUnset($offset)
* @return mixed|null
* @ignore
*/
public function offsetGet($offset)
public function offsetGet(mixed $offset): mixed
{

if (is_callable([$this, 'get' . $offset])) {
Expand Down Expand Up @@ -116,4 +116,4 @@ public function offsetGet($offset)

return null;
}
}
}
4 changes: 2 additions & 2 deletions src/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public function getAst()
* @return stdClass
* @ignore
*/
public function jsonSerialize () {
public function jsonSerialize (): mixed {

return $this->getAst();
}
Expand Down Expand Up @@ -652,4 +652,4 @@ public function toObject()
{
return $this->ast;
}
}
}
4 changes: 2 additions & 2 deletions src/Element/AtRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function addDeclaration ($name, $value) {
* @return \stdClass
* @ignore
*/
public function jsonSerialize () {
public function jsonSerialize (): mixed {

$ast = parent::jsonSerialize();

Expand All @@ -116,4 +116,4 @@ public function jsonSerialize () {

return $ast;
}
}
}
4 changes: 2 additions & 2 deletions src/Element/NestingRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class NestingRule extends Rule
/**
* @inheritDoc
*/
public function support(ElementInterface $child)
public function support(ElementInterface $child): bool
{

return true;
}
}
}
4 changes: 2 additions & 2 deletions src/Element/RuleList.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ public function remove(ElementInterface $element)
* return an iterator of child nodes
* @return ArrayIterator|Traversable
*/
public function getIterator()
public function getIterator(): \Traversable
{

return new ArrayIterator($this->ast->children ?? []);
}
}
}
4 changes: 2 additions & 2 deletions src/Parser/AccessTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public function __clone() {
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize(): mixed
{
return get_object_vars($this);
}
}
}
2 changes: 1 addition & 1 deletion src/Property/PropertyList.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public function isEmpty() {
/**
* @inheritDoc
*/
public function getIterator()
public function getIterator(): \Traversable
{
return $this->getProperties();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,13 @@ public static function parse($string, $property = null, bool $capture_whitespace
return $string;
}

if (trim($property) === '') {
if (trim((string)$property) === '') {

$property = null;
}

$string = trim($string);
$property = strtolower($property);
$property = strtolower((string)$property);

if ($property !== '') {

Expand Down Expand Up @@ -1466,8 +1466,8 @@ public function __toString()
return $this->render();
}

public function jsonSerialize()
public function jsonSerialize(): mixed
{
return $this->render();
}
}
}
Loading