From 2f0c3c0d75a9bb757dc8723ffeffac754981f07d Mon Sep 17 00:00:00 2001 From: Jan Skrasek Date: Wed, 20 Mar 2024 11:51:53 +0100 Subject: [PATCH] add missing array return type in ICollection::fetchAll() --- src/Collection/ArrayCollection.php | 2 +- src/Collection/DbalCollection.php | 2 +- src/Collection/EmptyCollection.php | 2 +- src/Collection/HasManyCollection.php | 2 +- src/Collection/ICollection.php | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) 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; /**