rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
895 stars 165 forks source link

make compatible with twig 3.9, twig_get_attribute is now internal func #441

Closed jtallant closed 2 months ago

jtallant commented 2 months ago

Merging this allows the package to run on Twig version 3.9. twig_get_attribute was moved to an internal function by twig so we can no longer directly call it.

Fixes #440

rudiedirkx commented 2 months ago

GetAttrNode::attribute() is executed A LOT on every page. Is repeating function_exists() fast enough? We only have to do that once? I can imagine PHP has to do some lookup everytime it's called.

jtallant commented 2 months ago

Not sure about that. I suppose we can just not check if the function exists and just return the call to Core. Either way this package doesn't work with 3.9 until this is merged.

barryvdh commented 2 months ago

Can we just bump the Twig requirement and skip the check? Not sure which version includes it, but if we use that version, we can just remove the old function.