From 253f88056596e7492d26c6603fa9387ce131caef Mon Sep 17 00:00:00 2001 From: "Thomas A. Hirsch" Date: Sat, 3 Feb 2024 20:58:20 +0100 Subject: [PATCH] PHP 8.1 > ReturnTypeWillChange attributes added --- lib/Doctrine/Collection/Iterator.php | 4 ++++ lib/Doctrine/Collection/Iterator/Expandable.php | 1 + lib/Doctrine/Collection/Iterator/Normal.php | 1 + lib/Doctrine/Collection/Iterator/Offset.php | 1 + lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php | 5 +++++ lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php | 5 +++++ lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php | 5 +++++ lib/Doctrine/Node/NestedSet/PreOrderIterator.php | 5 +++++ 8 files changed, 27 insertions(+) diff --git a/lib/Doctrine/Collection/Iterator.php b/lib/Doctrine/Collection/Iterator.php index 3fdc79cd0..1c6dbe283 100644 --- a/lib/Doctrine/Collection/Iterator.php +++ b/lib/Doctrine/Collection/Iterator.php @@ -74,6 +74,7 @@ public function __construct($collection) * * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->index = 0; @@ -88,6 +89,7 @@ public function rewind() * * @return integer */ + #[\ReturnTypeWillChange] public function key() { return $this->key; @@ -98,6 +100,7 @@ public function key() * * @return Doctrine_Record */ + #[\ReturnTypeWillChange] public function current() { return $this->collection->get($this->key); @@ -108,6 +111,7 @@ public function current() * * @return void */ + #[\ReturnTypeWillChange] public function next() { $this->index++; diff --git a/lib/Doctrine/Collection/Iterator/Expandable.php b/lib/Doctrine/Collection/Iterator/Expandable.php index 7c18c5c58..3bfab7dd5 100644 --- a/lib/Doctrine/Collection/Iterator/Expandable.php +++ b/lib/Doctrine/Collection/Iterator/Expandable.php @@ -32,6 +32,7 @@ */ class Doctrine_Collection_Iterator_Expandable extends Doctrine_Collection_Iterator { + #[\ReturnTypeWillChange] public function valid() { if ($this->index < $this->count) { diff --git a/lib/Doctrine/Collection/Iterator/Normal.php b/lib/Doctrine/Collection/Iterator/Normal.php index 540bdad63..c256bd6fb 100644 --- a/lib/Doctrine/Collection/Iterator/Normal.php +++ b/lib/Doctrine/Collection/Iterator/Normal.php @@ -35,6 +35,7 @@ class Doctrine_Collection_Iterator_Normal extends Doctrine_Collection_Iterator /** * @return boolean whether or not the iteration will continue */ + #[\ReturnTypeWillChange] public function valid() { return ($this->index < $this->count); diff --git a/lib/Doctrine/Collection/Iterator/Offset.php b/lib/Doctrine/Collection/Iterator/Offset.php index 181b73f21..128b1ef10 100644 --- a/lib/Doctrine/Collection/Iterator/Offset.php +++ b/lib/Doctrine/Collection/Iterator/Offset.php @@ -32,6 +32,7 @@ */ class Doctrine_Collection_Iterator_Offset extends Doctrine_Collection_Iterator { + #[\ReturnTypeWillChange] public function valid() { } } \ No newline at end of file diff --git a/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php b/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php index 6283563c3..718a85c0d 100644 --- a/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php +++ b/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php @@ -41,26 +41,31 @@ public function __construct($node, $opts) throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function rewind() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function valid() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function current() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function key() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function next() { throw new Doctrine_Exception('Not yet implemented'); diff --git a/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php b/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php index 1cc002f06..be67e3678 100644 --- a/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php +++ b/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php @@ -41,26 +41,31 @@ public function __construct($node, $opts) throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function rewind() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function valid() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function current() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function key() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function next() { throw new Doctrine_Exception('Not yet implemented'); diff --git a/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php b/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php index 4ea31bd8c..d00438fec 100644 --- a/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php +++ b/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php @@ -41,26 +41,31 @@ public function __construct($node, $opts) throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function rewind() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function valid() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function current() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function key() { throw new Doctrine_Exception('Not yet implemented'); } + #[\ReturnTypeWillChange] public function next() { throw new Doctrine_Exception('Not yet implemented'); diff --git a/lib/Doctrine/Node/NestedSet/PreOrderIterator.php b/lib/Doctrine/Node/NestedSet/PreOrderIterator.php index a35a72223..9cc399d7d 100644 --- a/lib/Doctrine/Node/NestedSet/PreOrderIterator.php +++ b/lib/Doctrine/Node/NestedSet/PreOrderIterator.php @@ -100,6 +100,7 @@ public function __construct($record, $opts) * * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->index = -1; @@ -111,6 +112,7 @@ public function rewind() * * @return integer */ + #[\ReturnTypeWillChange] public function key() { return $this->key; @@ -121,6 +123,7 @@ public function key() * * @return Doctrine_Record */ + #[\ReturnTypeWillChange] public function current() { $record = $this->collection->get($this->key); @@ -133,6 +136,7 @@ public function current() * * @return void */ + #[\ReturnTypeWillChange] public function next() { while ($current = $this->advanceIndex()) { @@ -149,6 +153,7 @@ public function next() /** * @return boolean whether or not the iteration will continue */ + #[\ReturnTypeWillChange] public function valid() { return ($this->index < $this->count);