From 41195493e1e42b66ac0f01e88f66dec09c5f2000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Marsza=C5=82?= Date: Wed, 24 Jan 2024 13:30:24 +0100 Subject: [PATCH] fix: missing return types --- common/class.Collection.php | 5 ++--- common/oatbox/filesystem/Directory.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/class.Collection.php b/common/class.Collection.php index fd600803c..4f283e4ee 100644 --- a/common/class.Collection.php +++ b/common/class.Collection.php @@ -88,7 +88,7 @@ public function __construct(common_Object $container, $debug = '') * @author Lionel Lecaque * @return int */ - public function count() + public function count(): int { $returnValue = (int) 0; @@ -238,9 +238,8 @@ public function offsetExists(common_Object $key) * @author Lionel Lecaque * @return mixed */ - public function getIterator() + public function getIterator(): ArrayIterator { - return new ArrayIterator($this->sequence); } diff --git a/common/oatbox/filesystem/Directory.php b/common/oatbox/filesystem/Directory.php index be239d313..060dfc716 100644 --- a/common/oatbox/filesystem/Directory.php +++ b/common/oatbox/filesystem/Directory.php @@ -21,6 +21,7 @@ namespace oat\oatbox\filesystem; +use ArrayIterator; use League\Flysystem\FileExistsException; class Directory extends FileSystemHandler implements \IteratorAggregate @@ -57,10 +58,8 @@ public function getFile($path) /** * Method constraints by IteratorAggregator, wrapper to getFlyIterator - * - * @return \ArrayIterator */ - public function getIterator() + public function getIterator(): ArrayIterator { return $this->getFlyIterator(); }