Closed elazar closed 8 years ago
It's been 8 months with no reply to this issue, so I'm going to assume that there's no interest in supporting this proposal in Auryn core. As such, I've created a supplemental library for this purpose and am closing this issue.
I've implemented this in a separate project and found that it works well. The code involved isn't much, but I think it encourages separation of concerns and reusability in injector configuration. If it seems like it would be better suited for a separate repo/package, fair enough, but I thought I'd introduce it here to see if there's any interest in bringing it into the Auryn core.
This is somewhat similar in concept to Silex service providers: it uses classes to encapsulate sets of injector configuration specific to a particular concern, such as integrating a third-party template engine.
Here's an example specific to the Diactoros library:
Another cool thing this allows for is groupings of configurations using something like this:
So you can then do something like this:
Or even this:
Thoughts?