Skip to content

Commit

Permalink
minor #4168 add type-hints to the LoopContext constructor (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.x branch.

Discussion
----------

add type-hints to the LoopContext constructor

see #4153 (comment)

Commits
-------

27e137a add type-hints to the LoopContext constructor
  • Loading branch information
fabpot committed Jul 31, 2024
2 parents 26b6e19 + 27e137a commit 96b11f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Runtime/LoopContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down Expand Up @@ -103,7 +103,7 @@ public function cycle($value, ...$values): mixed
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.');
Expand Down

0 comments on commit 96b11f7

Please sign in to comment.