twig-i18n-extension icon indicating copy to clipboard operation
twig-i18n-extension copied to clipboard

Method "Twig\Parser::getExpressionParser()" is deprecated

Open anzweidrej opened this issue 9 months ago • 2 comments

I don't know if this project is still ongoing, but it would be great if following deprecation issue would be resolved:

Since twig/twig 3.21: Method "Twig\Parser::getExpressionParser()" is deprecated, use "parseExpression()" instead.

Br,

anzweidrej avatar Jun 07 '25 21:06 anzweidrej

Thank you for reporting this issue! would you contribute a pull request?

How did you find the deprecation error?

williamdes avatar Jun 07 '25 22:06 williamdes

Thank you for reporting this issue! would you contribute a pull request?

How did you find the deprecation error?

Hello, sorry for the late reply. I found that the culprit was inside the i18n package after the application was throwing the mentioned error, since I am using it in one of my projects.

I will try to make a pull request as soon as possible. The solution is to replace $this->parser->getExpressionParser()->parseExpression(); with $this->parser->parseExpression(); in the TransTokenParser.php file.

Another option, as a quick remedy is to just suppress it with the '@' operator for now.

https://twig.symfony.com/doc/3.x/deprecated.html

Br,

anzweidrej avatar Jun 17 '25 16:06 anzweidrej