diff --git a/src/QueryPath/CSS/Selector.php b/src/QueryPath/CSS/Selector.php index 4b538bd8..53e923c3 100644 --- a/src/QueryPath/CSS/Selector.php +++ b/src/QueryPath/CSS/Selector.php @@ -58,7 +58,7 @@ public function __construct() { $this->selectors[$this->groupIndex][] = $this->currSelector; } - public function getIterator() { + public function getIterator(): \Traversable { return new \ArrayIterator($this->selectors); } @@ -73,7 +73,7 @@ public function toArray() { return $this->selectors; } - public function count() { + public function count(): int { return count($this->selectors); } diff --git a/src/QueryPath/DOMQuery.php b/src/QueryPath/DOMQuery.php index 15ab8938..c63346ed 100644 --- a/src/QueryPath/DOMQuery.php +++ b/src/QueryPath/DOMQuery.php @@ -364,7 +364,7 @@ public function size() { * @return int * The number of matches in the DOMQuery. */ - public function count() { + public function count(): int { return $this->matches->count(); } @@ -3985,7 +3985,7 @@ public function __call($name, $arguments) { * @return Iterable * Returns an iterator. */ - public function getIterator() { + public function getIterator(): \Traversable { $i = new QueryPathIterator($this->matches); $i->options = $this->options; return $i; diff --git a/src/QueryPath/QueryPathIterator.php b/src/QueryPath/QueryPathIterator.php index be2e66f0..7648a279 100644 --- a/src/QueryPath/QueryPathIterator.php +++ b/src/QueryPath/QueryPathIterator.php @@ -19,7 +19,7 @@ class QueryPathIterator extends \IteratorIterator { public $options = array(); private $qp = NULL; - public function current() { + public function current(): mixed { if (!isset($this->qp)) { $this->qp = \QueryPath::with(parent::current(), NULL, $this->options); }