Skip to content

Commit

Permalink
Add return type hint to ViewModel::getIterator()
Browse files Browse the repository at this point in the history
This is to satisfy static code analytic tools like PHPStan and Psalm.

Resolves #73

Signed-off-by: func0der <[email protected]>
  • Loading branch information
func0der committed Oct 17, 2023
1 parent 5164752 commit 46c379a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Model/ViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ViewModel implements ModelInterface, ClearableModelInterface, RetrievableC
* Child models
*
* @var array
* @psalm-type list<ModelInterface>
*/
protected $children = [];

Expand Down Expand Up @@ -508,7 +509,7 @@ public function count()
/**
* Get iterator of children
*
* @return ArrayIterator
* @return Traversable<int, ModelInterface>
*/
#[ReturnTypeWillChange]
public function getIterator()
Expand Down

0 comments on commit 46c379a

Please sign in to comment.