From 46c379a231d61be1ddf57e738f261410be561936 Mon Sep 17 00:00:00 2001 From: func0der <529819+func0der@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:32:20 +0200 Subject: [PATCH] Add return type hint to ViewModel::getIterator() This is to satisfy static code analytic tools like PHPStan and Psalm. Resolves #73 Signed-off-by: func0der <529819+func0der@users.noreply.github.com> --- src/Model/ViewModel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/ViewModel.php b/src/Model/ViewModel.php index 759e8b981..a33ca643a 100644 --- a/src/Model/ViewModel.php +++ b/src/Model/ViewModel.php @@ -32,6 +32,7 @@ class ViewModel implements ModelInterface, ClearableModelInterface, RetrievableC * Child models * * @var array + * @psalm-type list */ protected $children = []; @@ -508,7 +509,7 @@ public function count() /** * Get iterator of children * - * @return ArrayIterator + * @return Traversable */ #[ReturnTypeWillChange] public function getIterator()