JMSI18nRoutingBundle icon indicating copy to clipboard operation
JMSI18nRoutingBundle copied to clipboard

Unexpected token T_CLASS

Open gdeconsulting opened this issue 10 years ago • 2 comments

This problem appears when extracting routes. The code MyClass :: class is not appreciated by the parser.

Command:

php app/console translation:extract fr nl en --config=routes

Error:

[RuntimeException] Could not parse "...": Unexpected token T_CLASS on line 232

gdeconsulting avatar Dec 09 '14 10:12 gdeconsulting

+1

vgross avatar Jan 15 '16 23:01 vgross

The issue is with the JMSTranslationBundle. More specifically, the 1.1.0 release of that bundle requires an old version (0.9.1) of the nikic/php-parser, which doesn't seem to handle MyClass::class . This is fixed on GitHub, but not in the latest release (1.1.0). I was able to resolve the issue but changing the line "jms/translation-bundle": "^1.1.0", to "jms/translation-bundle": "dev-master", in my app's composer.json. Hope this helps.

jeffclemens avatar Jan 26 '16 21:01 jeffclemens