From c43521226011bd10381c9077b7c3ee14e4b21e89 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 25 Apr 2022 22:05:56 +0300 Subject: Get rid of warnings on PHP 8.1 This is mostly about adding return types to methods that implement PHP interfaces, and not passing null to core functions that want a string. After this patch, and an update to return types in RemexHtml, tests/phpunit/integration/ has no more errors than in PHP 8.0. Bug: T289879 Bug: T289926 Change-Id: Ia424f5cc897070f4188ae126b5bf6a1f552db0e1 --- includes/libs/iterators/IteratorDecorator.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'includes/libs/iterators') diff --git a/includes/libs/iterators/IteratorDecorator.php b/includes/libs/iterators/IteratorDecorator.php index 00eca9674e7e..28dfdbd2a5f3 100644 --- a/includes/libs/iterators/IteratorDecorator.php +++ b/includes/libs/iterators/IteratorDecorator.php @@ -38,6 +38,7 @@ abstract class IteratorDecorator implements Iterator { * @inheritDoc * @stable to override */ + #[\ReturnTypeWillChange] public function current() { return $this->iterator->current(); } @@ -46,6 +47,7 @@ abstract class IteratorDecorator implements Iterator { * @inheritDoc * @stable to override */ + #[\ReturnTypeWillChange] public function key() { return $this->iterator->key(); } @@ -54,7 +56,7 @@ abstract class IteratorDecorator implements Iterator { * @inheritDoc * @stable to override */ - public function next() { + public function next(): void { $this->iterator->next(); } @@ -62,7 +64,7 @@ abstract class IteratorDecorator implements Iterator { * @inheritDoc * @stable to override */ - public function rewind() { + public function rewind(): void { $this->iterator->rewind(); } @@ -70,7 +72,7 @@ abstract class IteratorDecorator implements Iterator { * @inheritDoc * @stable to override */ - public function valid() { + public function valid(): bool { return $this->iterator->valid(); } } -- cgit v1.2.3