mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 15:37:58 +00:00
add type-hints to the LoopContext constructor
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user