diff options
author | Aryeh Gregor <ayg@aryeh.name> | 2022-04-25 22:05:56 +0300 |
---|---|---|
committer | Kevin Israel <pleasestand@live.com> | 2022-06-13 04:42:20 -0400 |
commit | c43521226011bd10381c9077b7c3ee14e4b21e89 (patch) | |
tree | 48600c15172ac9731c765bbda2841fe7383a009f /includes/libs/iterators | |
parent | 89518d5024fab41fa6a153e6539ae0a6597d249d (diff) | |
download | mediawikicore-c43521226011bd10381c9077b7c3ee14e4b21e89.tar.gz mediawikicore-c43521226011bd10381c9077b7c3ee14e4b21e89.zip |
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
Diffstat (limited to 'includes/libs/iterators')
-rw-r--r-- | includes/libs/iterators/IteratorDecorator.php | 8 |
1 files changed, 5 insertions, 3 deletions
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(); } } |