JMSI18nRoutingBundle
JMSI18nRoutingBundle copied to clipboard
Unexpected token T_CLASS
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
+1
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.