mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 07:27:17 +00:00
a7e497af48
This PR was merged into the 3.x branch.
Discussion
----------
Fix isset in ForLoopNode
Even though the code works perfectly fine, PHPStan doesn't understand it.
> Offset 'revindex0' does not exist on array{parent: array{index0: int<1, max>, index: int<2, max>, first: false, revindex0?: int, revindex?: int, length: int<0, max>, last?: bool}.
> Offset 'revindex' does not exist on array{parent: array{index0: int<1, max>, index: int<2, max>, first: false, revindex0: int, revindex?: int, length: int<0, max>, last?: bool}.
Since we want to work with `revindex` and `revindex0`, we can better check for their existence, instead of `length`.
/cc `@stof` `@fabpot`
Commits
-------
2b887e64 Fix isset in ForLoopNode