Skip to content

PHP 8.1 fix deprecation notices #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/QueryPath/CSS/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -73,7 +73,7 @@ public function toArray() {
return $this->selectors;
}

public function count() {
public function count(): int {
return count($this->selectors);
}

Expand Down
4 changes: 2 additions & 2 deletions src/QueryPath/DOMQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/QueryPath/QueryPathIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down