console-extra-bundle icon indicating copy to clipboard operation
console-extra-bundle copied to clipboard

Complete override not necessary anymore

Open havvg opened this issue 12 years ago • 2 comments

Since symfony/symfony#8182 has been merged, it's not necessary anymore to have a complete override of Bundle::registerCommands.

Commands with dependencies will not be registered (as it's not possible) automatically,

Is there any other reason to add the override? I mean adding each command as a service for its sake only doesn't seem reasonable to me.

havvg avatar Jul 08 '13 09:07 havvg

Thanks for the input! In fact, I haven't seen this change so far.

I'm not really opinionated about whether all commands should be defined as services. If one does not override Bundle::registerCommands, the commands that don't have dependencies should be registered by the default mechanism. If one of those commands is defined as service as well, it should be re-registered, which shouldn't have any effect (I haven't had the chance to test this, yet). If a command is not defined as a service, it will be registered only once. This way, everybody's requirements should be fulfilled, right? If so, I will just remove the section where Bundle::registerCommands is overridden from the README. Also, feel free to submit PRs for such small changes ;-)

seiffert avatar Jul 08 '13 09:07 seiffert

Well, I wasn't sure, how to handle it, therefore no PR yet :-)

The only thing I could come up with would be optional "dependencies", like setLogger or similar, where you would want to not have the same command registered twice (which afaik would fail).

havvg avatar Jul 08 '13 09:07 havvg