N°4517 - PHP 8.1: Fix return types to match Iterator interface

This commit is contained in:
Molkobain
2022-05-16 08:16:02 +02:00
committed by acognet
parent 212565b01e
commit 7ee5184afc
2 changed files with 10 additions and 10 deletions

View File

@@ -374,7 +374,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
* @throws \MySQLException
* @throws \MySQLHasGoneAwayException
*/
public function current()
public function current(): mixed
{
$this->LoadOriginalIds();
@@ -409,7 +409,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public function next()
public function next(): void
{
$this->LoadOriginalIds();
@@ -439,7 +439,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
* @link http://php.net/manual/en/iterator.key.php
* @return mixed scalar on success, or null on failure.
*/
public function key()
public function key(): mixed
{
return $this->iCursor;
}
@@ -454,7 +454,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public function valid()
public function valid(): bool
{
$this->LoadOriginalIds();
@@ -472,7 +472,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public function rewind()
public function rewind(): void
{
$this->LoadOriginalIds();

View File

@@ -745,27 +745,27 @@ class RelationTypeIterator implements Iterator
}
}
public function rewind()
public function rewind(): void
{
$this->iCurrentIdx = 0;
}
public function valid()
public function valid(): bool
{
return array_key_exists($this->iCurrentIdx, $this->aList);
}
public function next()
public function next(): void
{
$this->iCurrentIdx++;
}
public function current()
public function current(): mixed
{
return $this->aList[$this->iCurrentIdx];
}
public function key()
public function key(): mixed
{
return $this->iCurrentIdx;
}