Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Inconsistent annotations and signatures in Node.php

Open Joon-99 opened this issue 1 year ago • 2 comments

https://github.com/twigphp/Twig/blob/3.x/src/Node/Node.php

Line 197 onwards, a few methods are said to accept either an int or a string, but the signature only accepts a string, there are a few methods like this.

I have an old symfony project that looks like it used to call hasNode() and getNode() with an int, I assume that it's the annotations that are deprecated and that there are no plans to keep the int in the signature?

Thank you for your time.

Joon-99 avatar Mar 06 '25 11:03 Joon-99

In fact, 4.0 will allow int (see #4223 for the preparation in 3.x and bca2d993b04686d49535e3fda9fc43071b4a07f3 for the type update in 4.x).

xabbuh avatar Mar 06 '25 11:03 xabbuh

In fact, 4.0 will allow int (see #4223 for the preparation in 3.x and bca2d99 for the type update in 4.x).

Thanks for the quick reply. I'll just close this then.

Joon-99 avatar Mar 06 '25 12:03 Joon-99