diff --git a/src/Collection/ArrayCollection.php b/src/Collection/ArrayCollection.php index 3e4ba3e0..4abb1e89 100644 --- a/src/Collection/ArrayCollection.php +++ b/src/Collection/ArrayCollection.php @@ -166,7 +166,7 @@ public function fetchChecked(): IEntity } - public function fetchAll() + public function fetchAll(): array { return iterator_to_array($this->getIterator(), preserve_keys: false); } diff --git a/src/Collection/DbalCollection.php b/src/Collection/DbalCollection.php index 6a3b6d88..ca41af86 100644 --- a/src/Collection/DbalCollection.php +++ b/src/Collection/DbalCollection.php @@ -179,7 +179,7 @@ public function fetchChecked(): IEntity } - public function fetchAll() + public function fetchAll(): array { return iterator_to_array($this->getIterator(), preserve_keys: false); } diff --git a/src/Collection/EmptyCollection.php b/src/Collection/EmptyCollection.php index 34dbd2c4..d0e8f4c4 100644 --- a/src/Collection/EmptyCollection.php +++ b/src/Collection/EmptyCollection.php @@ -81,7 +81,7 @@ public function fetchChecked(): IEntity } - public function fetchAll() + public function fetchAll(): array { return []; } diff --git a/src/Collection/HasManyCollection.php b/src/Collection/HasManyCollection.php index a32d1ab4..3e1e0d53 100644 --- a/src/Collection/HasManyCollection.php +++ b/src/Collection/HasManyCollection.php @@ -151,7 +151,7 @@ public function fetchChecked(): IEntity } - public function fetchAll() + public function fetchAll(): array { return iterator_to_array($this->getIterator(), preserve_keys: false); } diff --git a/src/Collection/ICollection.php b/src/Collection/ICollection.php index 404fd4fc..05e36af9 100644 --- a/src/Collection/ICollection.php +++ b/src/Collection/ICollection.php @@ -178,10 +178,9 @@ public function fetchChecked(): IEntity; /** * Fetches all records. - * @return IEntity[] * @return list */ - public function fetchAll(); + public function fetchAll(): array; /**