diff options
author | Mark A. Hershberger <mah@nichework.com> | 2022-07-04 13:07:51 -0400 |
---|---|---|
committer | Brian Wolff <bawolff+wn@gmail.com> | 2022-07-25 18:06:24 +0000 |
commit | 6266ae4b11dcfc588909aa87a0363db640f90620 (patch) | |
tree | 2ae8144b620ab66018aad1ca50ac3e844379c7e4 | |
parent | 6dd11fbb8e29ed6873762570b52627fa67840291 (diff) | |
download | mediawikicore-6266ae4b11dcfc588909aa87a0363db640f90620.tar.gz mediawikicore-6266ae4b11dcfc588909aa87a0363db640f90620.zip |
Add signature for implementations of RecursiveIterator
Change-Id: I767fe31444167cbe08ef6900abc60c635c005cd0
-rw-r--r-- | includes/libs/iterators/NotRecursiveIterator.php | 4 | ||||
-rw-r--r-- | includes/utils/BatchRowIterator.php | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/includes/libs/iterators/NotRecursiveIterator.php b/includes/libs/iterators/NotRecursiveIterator.php index 22ff7e7bd4ba..a3e1e56cc660 100644 --- a/includes/libs/iterators/NotRecursiveIterator.php +++ b/includes/libs/iterators/NotRecursiveIterator.php @@ -25,11 +25,11 @@ * @ingroup Maintenance */ class NotRecursiveIterator extends IteratorDecorator implements RecursiveIterator { - public function hasChildren() { + public function hasChildren(): bool { return false; } - public function getChildren() { + public function getChildren(): ?RecursiveIterator { // @phan-suppress-next-line PhanTypeMismatchReturnProbablyReal False positive return null; } diff --git a/includes/utils/BatchRowIterator.php b/includes/utils/BatchRowIterator.php index 74c0e340cbcf..02b205e490b4 100644 --- a/includes/utils/BatchRowIterator.php +++ b/includes/utils/BatchRowIterator.php @@ -216,14 +216,14 @@ class BatchRowIterator implements RecursiveIterator { /** * @return bool True when this result set has rows */ - public function hasChildren() { + public function hasChildren(): bool { return $this->current && count( $this->current ); } /** - * @return RecursiveIterator + * @return null|RecursiveIterator */ - public function getChildren() { + public function getChildren(): ?RecursiveIterator { return new NotRecursiveIterator( new ArrayIterator( $this->current ) ); } |