1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +02:00
This commit is contained in:
Ryan Cramer
2022-01-24 11:07:10 -05:00
parent beaad6e8dd
commit 25da592578
5 changed files with 9 additions and 3 deletions

View File

@@ -135,6 +135,7 @@ class PageArrayIterator extends Wire implements \Iterator {
* Rewind to beginning
*
*/
#[\ReturnTypeWillChange]
public function rewind() {
$this->pagesPosition = 0;
$this->position = 0;
@@ -149,6 +150,7 @@ class PageArrayIterator extends Wire implements \Iterator {
* @return Page
*
*/
#[\ReturnTypeWillChange]
public function current() {
return $this->pages[$this->pagesPosition];
}
@@ -159,6 +161,7 @@ class PageArrayIterator extends Wire implements \Iterator {
* @return int
*
*/
#[\ReturnTypeWillChange]
public function key() {
return $this->position;
}
@@ -167,6 +170,7 @@ class PageArrayIterator extends Wire implements \Iterator {
* Update current position to next
*
*/
#[\ReturnTypeWillChange]
public function next() {
$this->pagesPosition++;
$this->position++;
@@ -178,6 +182,7 @@ class PageArrayIterator extends Wire implements \Iterator {
* @return bool
*
*/
#[\ReturnTypeWillChange]
public function valid() {
if($this->position === 0 || $this->pagesPosition >= $this->pagesCount) {
// If we have just been rewound or if we have reached the end of the buffer,