D
D
Dmitry2018-02-20 00:28:09
symfony
Dmitry, 2018-02-20 00:28:09

Is it possible to autowire handlers for Tactician commands in Symfony 4?

Symfony 4 + Tactician Bundle .
Everything works, but the following does not suit.
Each command handler must be registered manually in the configuration (services). I found an RFC
about this , which involves auto-registration of handlers (if you use type hinting in them), but, apparently, it was not implemented, as I understand it. Is it possible to register all handlers, for example, by wildcard filename or namespace ( App\Command\Handlers\* )? I admit something like this: - command: App\Command\RegisterUser ; - handler: App\Command\RegisterUserHandler ;



That is, in this case, the command will be automatically processed by a handler with the same name ending in Handler .
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question