schmittjoh / JMSI18nRoutingBundle

Allows you to internationalize your routing
http://jmsyst.com/bundles/JMSI18nRoutingBundle
358 stars 159 forks source link

Unexpected token T_CLASS #140

Open gdeconsulting opened 9 years ago

gdeconsulting commented 9 years ago

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

vgross commented 8 years ago

+1

jeffclemens commented 8 years ago

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.