From d7c9e96232d870e5f13e5fbbf00b5c845f322e7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 20 Sep 2021 16:23:41 +0200 Subject: [PATCH] Fix return type for SeekableIterator::* implementations The `mixed` type is not available with our current minimum PHP version, thus using ReturnTypeWillChange for these. --- .../files/lib/data/DatabaseObjectList.class.php | 10 ++++++---- .../lib/data/label/group/ViewableLabelGroup.class.php | 10 ++++++---- .../lib/data/smiley/category/SmileyCategory.class.php | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php index 2741d80696..596cc4c98a 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php @@ -317,6 +317,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject /** * @inheritDoc */ + #[\ReturnTypeWillChange] public function current() { $objectID = $this->indexToObject[$this->index]; @@ -330,6 +331,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject * * @see \Iterator::key() */ + #[\ReturnTypeWillChange] public function key() { return $this->indexToObject[$this->index]; @@ -338,7 +340,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject /** * @inheritDoc */ - public function next() + public function next(): void { $this->index++; } @@ -346,7 +348,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject /** * @inheritDoc */ - public function rewind() + public function rewind(): void { $this->index = 0; } @@ -354,7 +356,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject /** * @inheritDoc */ - public function valid() + public function valid(): bool { return isset($this->indexToObject[$this->index]); } @@ -362,7 +364,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject /** * @inheritDoc */ - public function seek($offset) + public function seek($offset): void { $this->index = $offset; diff --git a/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php b/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php index f9923c7b0e..d80f9e844a 100644 --- a/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php +++ b/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php @@ -179,6 +179,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, /** * @inheritDoc */ + #[\ReturnTypeWillChange] public function current() { $objectID = $this->indexToObject[$this->index]; @@ -192,6 +193,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, * * @inheritDoc */ + #[\ReturnTypeWillChange] public function key() { return $this->indexToObject[$this->index]; @@ -200,7 +202,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, /** * @inheritDoc */ - public function next() + public function next(): void { $this->index++; } @@ -208,7 +210,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, /** * @inheritDoc */ - public function rewind() + public function rewind(): void { $this->index = 0; } @@ -216,7 +218,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, /** * @inheritDoc */ - public function valid() + public function valid(): bool { return isset($this->indexToObject[$this->index]); } @@ -224,7 +226,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, /** * @inheritDoc */ - public function seek($offset) + public function seek($offset): void { $this->index = $offset; diff --git a/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php index ac43aed81c..0ad5dc3c8a 100644 --- a/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php +++ b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php @@ -66,6 +66,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT * @inheritDoc * @return Smiley */ + #[\ReturnTypeWillChange] public function current() { $objectID = $this->indexToObject[$this->index]; @@ -79,6 +80,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT * * @see \Iterator::key() */ + #[\ReturnTypeWillChange] public function key() { return $this->indexToObject[$this->index]; @@ -87,7 +89,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT /** * @inheritDoc */ - public function next() + public function next(): void { $this->index++; } @@ -95,7 +97,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT /** * @inheritDoc */ - public function rewind() + public function rewind(): void { $this->index = 0; } @@ -103,7 +105,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT /** * @inheritDoc */ - public function valid() + public function valid(): bool { return isset($this->indexToObject[$this->index]); } @@ -111,7 +113,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT /** * @inheritDoc */ - public function seek($offset) + public function seek($offset): void { $this->index = $offset; -- 2.20.1