diff --git a/src/ArrayTrait.php b/src/ArrayTrait.php index d8768471..e778942b 100755 --- a/src/ArrayTrait.php +++ b/src/ArrayTrait.php @@ -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])) { @@ -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]) || @@ -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])) { @@ -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])) { @@ -116,4 +116,4 @@ public function offsetGet($offset) return null; } -} \ No newline at end of file +} diff --git a/src/Element.php b/src/Element.php index 4983effd..6cd043b9 100755 --- a/src/Element.php +++ b/src/Element.php @@ -613,7 +613,7 @@ public function getAst() * @return stdClass * @ignore */ - public function jsonSerialize () { + public function jsonSerialize (): mixed { return $this->getAst(); } @@ -652,4 +652,4 @@ public function toObject() { return $this->ast; } -} \ No newline at end of file +} diff --git a/src/Element/AtRule.php b/src/Element/AtRule.php index 36a7786a..3b6034ab 100755 --- a/src/Element/AtRule.php +++ b/src/Element/AtRule.php @@ -100,7 +100,7 @@ public function addDeclaration ($name, $value) { * @return \stdClass * @ignore */ - public function jsonSerialize () { + public function jsonSerialize (): mixed { $ast = parent::jsonSerialize(); @@ -116,4 +116,4 @@ public function jsonSerialize () { return $ast; } -} \ No newline at end of file +} diff --git a/src/Element/NestingRule.php b/src/Element/NestingRule.php index c9995c77..18c95d7c 100755 --- a/src/Element/NestingRule.php +++ b/src/Element/NestingRule.php @@ -10,9 +10,9 @@ class NestingRule extends Rule /** * @inheritDoc */ - public function support(ElementInterface $child) + public function support(ElementInterface $child): bool { return true; } -} \ No newline at end of file +} diff --git a/src/Element/RuleList.php b/src/Element/RuleList.php index 540e5bd6..93fd6f03 100755 --- a/src/Element/RuleList.php +++ b/src/Element/RuleList.php @@ -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 ?? []); } -} \ No newline at end of file +} diff --git a/src/Parser/AccessTrait.php b/src/Parser/AccessTrait.php index b7b3c8b2..190a54fd 100755 --- a/src/Parser/AccessTrait.php +++ b/src/Parser/AccessTrait.php @@ -52,8 +52,8 @@ public function __clone() { /** * @return array */ - public function jsonSerialize() + public function jsonSerialize(): mixed { return get_object_vars($this); } -} \ No newline at end of file +} diff --git a/src/Property/PropertyList.php b/src/Property/PropertyList.php index d9fde4bf..041fdd2e 100755 --- a/src/Property/PropertyList.php +++ b/src/Property/PropertyList.php @@ -360,7 +360,7 @@ public function isEmpty() { /** * @inheritDoc */ - public function getIterator() + public function getIterator(): \Traversable { return $this->getProperties(); } diff --git a/src/Value.php b/src/Value.php index c5050752..fad6084d 100755 --- a/src/Value.php +++ b/src/Value.php @@ -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 !== '') { @@ -1466,8 +1466,8 @@ public function __toString() return $this->render(); } - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->render(); } -} \ No newline at end of file +}