thephpleague / tactician-container

Load Tactician handlers from any PSR-11/container-interop container
MIT License
75 stars 8 forks source link

Allow callable as well as array for $commandNameToHandlerMap #14

Open kleijnweb opened 6 years ago

kleijnweb commented 6 years ago

As title. Assuming your command name -> handler mapping name follows some pattern, this would make it a lot less cumbersome to use.

rosstuck commented 6 years ago

Sounds legit, could also be a separate implementation of the same interface to keep the code simpler. I think in many of these cases, folks are simply implementing their own version of the interface since it's basically one method anyways.

Still, if you'd like to send a PR for this, I'll review and merge it. :+1: