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; }