As discussed on the original Tactician issue, creating the Handlers on the fly in the middleware has two issues:
We can't easily have Handlers with dependencies (very common scenario)
We have to use a custom version of the middleware
We could solve both by implementing a HandlerLocator that loads Handlers from the service container. The quick fix would be to change the command class names to accept a service container id and load from that in the HandlerLocator. A more symfony style might be to use a DI tag though. :)
As discussed on the original Tactician issue, creating the Handlers on the fly in the middleware has two issues:
We could solve both by implementing a HandlerLocator that loads Handlers from the service container. The quick fix would be to change the command class names to accept a service container id and load from that in the HandlerLocator. A more symfony style might be to use a DI tag though. :)