Skip to content

Commit

Permalink
[TASK] Use list whereever possible
Browse files Browse the repository at this point in the history
The types in the stubs should be as narrow as possible:
When an array with continuous integer keys starting with 0
is returned, this is a `list`, and it should be annotated as such.
  • Loading branch information
oliverklee committed Jul 25, 2024
1 parent a7549f5 commit 39849fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions stubs/ObjectStorage.stub
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class ObjectStorage implements \Iterator, \ArrayAccess
public function key();

/**
* @return array<TEntity>
* @return list<TEntity>
*/
public function toArray();

/**
* @return array<TEntity>
* @return list<TEntity>
*/
public function getArray();

Expand Down
2 changes: 1 addition & 1 deletion stubs/QueryResultInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface QueryResultInterface extends \Countable, \Iterator, \ArrayAccess
public function getFirst();

/**
* @return ModelType[]
* @return list<ModelType>
*/
public function toArray();
}

0 comments on commit 39849fa

Please sign in to comment.