Files
Twig/tests/Node
Fabien Potencier a7e497af48 minor #4280 Fix isset in ForLoopNode (ruudk)
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
2024-09-06 12:33:51 +02:00
..
2024-09-06 12:33:38 +02:00
2024-09-05 09:24:38 +02:00
2024-09-06 09:42:11 +02:00