From 61be903eb2eeff5924667a33cb1bc90b086b44b2 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 16 Jan 2023 14:21:00 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04517=20-=20PHP=208.1:=20Fix=20return=20t?= =?UTF-8?q?ype=20hint=20for=20iterable=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobjectiterator.php | 2 +- core/dbobjectset.class.php | 2 +- core/ormlinkset.class.inc.php | 14 +++++++------- core/simplegraph.class.inc.php | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/dbobjectiterator.php b/core/dbobjectiterator.php index 85e1e5208..264b57ba3 100644 --- a/core/dbobjectiterator.php +++ b/core/dbobjectiterator.php @@ -38,7 +38,7 @@ interface iDBObjectSetIterator extends Countable * * @return int */ - public function Count(); + public function Count(): int; /** * Reset the cursor to the first item in the collection. Equivalent to Seek(0) diff --git a/core/dbobjectset.class.php b/core/dbobjectset.class.php index 6e70cbc3b..a5c25ab9c 100644 --- a/core/dbobjectset.class.php +++ b/core/dbobjectset.class.php @@ -843,7 +843,7 @@ class DBObjectSet implements iDBObjectSetIterator * @throws \MySQLException * @throws \MySQLHasGoneAwayException */ - public function Count() + public function Count(): int { if (is_null($this->m_iNumTotalDBRows)) { diff --git a/core/ormlinkset.class.inc.php b/core/ormlinkset.class.inc.php index 43d433c12..131a28a14 100644 --- a/core/ormlinkset.class.inc.php +++ b/core/ormlinkset.class.inc.php @@ -312,7 +312,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws \CoreUnexpectedValue * @throws \MySQLException */ - public function Count() + public function Count(): int { $this->LoadOriginalIds(); $iRet = count($this->aPreserved) + count($this->aAdded) + count($this->aModified); @@ -327,7 +327,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws Exception * @internal param int $iRow */ - public function Seek($iPosition) + public function Seek($iPosition): void { $this->LoadOriginalIds(); @@ -375,7 +375,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws \MySQLException * @throws \MySQLHasGoneAwayException */ - public function current() + public function current(): mixed { $this->LoadOriginalIds(); @@ -410,7 +410,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws \CoreUnexpectedValue * @throws \MySQLException */ - public function next() + public function next(): void { $this->LoadOriginalIds(); @@ -440,7 +440,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; } @@ -455,7 +455,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws \CoreUnexpectedValue * @throws \MySQLException */ - public function valid() + public function valid(): bool { $this->LoadOriginalIds(); @@ -473,7 +473,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws \CoreUnexpectedValue * @throws \MySQLException */ - public function rewind() + public function rewind(): void { $this->LoadOriginalIds(); diff --git a/core/simplegraph.class.inc.php b/core/simplegraph.class.inc.php index 979992efb..1c5304d1a 100644 --- a/core/simplegraph.class.inc.php +++ b/core/simplegraph.class.inc.php @@ -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; }