add type-hints to the LoopContext constructor

This commit is contained in:
Christian Flothmann
2024-07-30 16:12:54 +02:00
parent 1a83f2c95b
commit 27e137a65d
+5 -5
View File
@@ -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.');