Skip to content

Commit

Permalink
add missing array return type in ICollection::fetchAll()
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Mar 20, 2024
1 parent cc4142f commit 2f0c3c0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Collection/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function fetchChecked(): IEntity
}


public function fetchAll()
public function fetchAll(): array
{
return iterator_to_array($this->getIterator(), preserve_keys: false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/DbalCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function fetchChecked(): IEntity
}


public function fetchAll()
public function fetchAll(): array
{
return iterator_to_array($this->getIterator(), preserve_keys: false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/EmptyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function fetchChecked(): IEntity
}


public function fetchAll()
public function fetchAll(): array
{
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/HasManyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function fetchChecked(): IEntity
}


public function fetchAll()
public function fetchAll(): array
{
return iterator_to_array($this->getIterator(), preserve_keys: false);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Collection/ICollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@ public function fetchChecked(): IEntity;

/**
* Fetches all records.
* @return IEntity[]
* @return list<E>
*/
public function fetchAll();
public function fetchAll(): array;


/**
Expand Down

0 comments on commit 2f0c3c0

Please sign in to comment.