minor #4316 Set IteratorAggregate generics for Node (ruudk)

This PR was merged into the 3.x branch.

Discussion
----------

Set IteratorAggregate generics for Node

This will help PHPStan and Psalm to understand what happens when iterating over a Node.

/cc `@fabpot`

Commits
-------

ba6e856d92 Set IteratorAggregate generics for Node
This commit is contained in:
Fabien Potencier
2024-09-13 15:40:58 +02:00
+2
View File
@@ -20,6 +20,8 @@ use Twig\Source;
* Represents a node in the AST.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @implements \IteratorAggregate<int|string, Node>
*/
#[YieldReady]
class Node implements \Countable, \IteratorAggregate