From 27e137a65def3fabb6b9dcbb5daaeb2491163203 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 30 Jul 2024 16:12:54 +0200 Subject: [PATCH] add type-hints to the LoopContext constructor --- src/Runtime/LoopContext.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Runtime/LoopContext.php b/src/Runtime/LoopContext.php index 66755987a..1bcb3093a 100644 --- a/src/Runtime/LoopContext.php +++ b/src/Runtime/LoopContext.php @@ -24,10 +24,10 @@ final class LoopContext public function __construct( private LoopIterator $loop, - private $parent, - private $blocks, - private $recurseFunc, - private $depth, + private mixed $parent, + private array $blocks, + private \Closure $recurseFunc, + private int $depth, ) { } @@ -103,7 +103,7 @@ final class LoopContext return $values[$this->getIndex0() % count($values)]; } - public function __invoke($iterator): \Generator + public function __invoke($iterator): iterable { if ($this->depth > 50) { throw new \RuntimeException('Nesting level too deep.');