thephpleague / tactician-bundle

Bundle to integrate Tactician with Symfony projects
MIT License
245 stars 43 forks source link

One handler for all commands (in v0.4.1) #86

Closed miguelrs closed 7 years ago

miguelrs commented 7 years ago

I'm trying to introduce Tactician in a Symfony project, but I need to stick to v0.4.1, as I'm on PHP 5.5 😞

For reasons I'm not going to explain in detail, I need to create a command bus whose handler handles all the existing commands...
In master branch, I think you can do that by adding a custom HandlerMapping, but in 0.4.1 I can't see that...

Is there any approach I can use?
And if not, would it be possible to add that functionality to 0.4.1 (I don't think PHP 7 is required for that, is it)?

miguelrs commented 7 years ago

Actually, looking at it, I think I just need to create a custom Locator, and then define my own command handler service, where I can inject my locator, and use that as the last middleware parameter for my bus... 👌

rosstuck commented 7 years ago

Hi Miguel,

Quick answer because I'm at lunch but you can just define your own middleware and put it at the end of the chain. That'll be easier than defining your own locator etc. :)

On Nov 13, 2017 12:34 PM, "Miguel Rosales" notifications@github.com wrote:

Closed #86 https://github.com/thephpleague/tactician-bundle/issues/86.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thephpleague/tactician-bundle/issues/86#event-1338510060, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI9TsAx4rE5o4Et0AbJyKM7-m8oZ7ljks5s2ClLgaJpZM4Qbl6r .