maker-bundle icon indicating copy to clipboard operation
maker-bundle copied to clipboard

Add possibility to override Message and MessageHandler namespace

Open welcoMattic opened this issue 2 years ago • 3 comments

The make command that generates Message and MessageHandler doesn't provide a way to customize the namespace, by default Message are under $rootNamespace.'\Message' and MessageHandler under $rootNamespace.'\MessageHandler'

It could be nice to give to user the ability to customize those namespaces like:

$rootNamespace.'\Messenger\Message' and $rootNamespace.'\Messenger\Handler'

I see it as a new config option:

messenger_namespaces:
    message: 'Messenger\Message'
    handler: 'Messenger\Handler'

It also lets user organize all Messenger related classes under an unique namespace:

messenger_namespaces:
    message: 'Messenger'
    handler: 'Messenger'

welcoMattic avatar May 25 '22 13:05 welcoMattic

We've typically shyed away from making things configurable to avoid become the monster that SensioGeneratorBundle was (monster in that it was SO customizable, that it was difficult to add new features). This seems harmless, but unless more people are asking for this, I'd like to avoid doing it. If we make these configurable, we could/should make all namespaces configurable.

Cheers!

weaverryan avatar May 26 '22 13:05 weaverryan

Totally understabable 👍 At least could we let users specifying complete namespace in command argument?

welcoMattic avatar May 26 '22 16:05 welcoMattic

Yes - I think we would just need to ask a new question: “what do you want to call the handler class” (I think we don’t ask that now) and this would accept a short name or a fully qualified class name :)

weaverryan avatar May 27 '22 12:05 weaverryan