schmittjoh/JMSTranslationBundle — pull request #187 by damienalexandre (2014-03-26 08:58:19+00:00)
Title: Allow to extend the DefaultPhpFileExtractor watched methods

The methods extracted in `DefaultPhpFileExtractor` are hard-coded `trans` and `transchoice`, this make it very hard to add a needed extraction method (in fact we are forced to copy the full class to alter it behavior just a bit).

My proposal is to expose the list of methods to extract in a `protected` property,
allowing anyone to extend `DefaultPhpFileExtractor` and just define some more methods to extract with their "domain" parameter offset (can be "-1" if there is none).

The use case for me is that I have shortcuts in my Controllers to create error and success flash messages. I call a `addErrorFlash("translation_key");` and my BaseController do the translator `trans()` call for me, leaving my Controllers clean and without noise. But I then need the translation extractor to watch for `adderrorflash` too.

Thx a lot,
Damien