Added call method to the container. #116
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok as promised here's the second pull request for the container class. 100% backwards compatible and tested.
The new call method allows you to execute a callable and inject its dependencies using the container.
I have a third pull request that I'm working on but its a bit bigger so I'll probably wait until tomorrow since its getting pretty late here. I have a working prototype but I want to go through the code and write some more tests for it.
What I'm working on is making the route dispatcher execute the action using the
Container::callmethod. This will enable us to inject dependencies directly into the rote controller methods and/or closures. We're converting some Silex applications to Mako and its a pretty useful feature that they have.It would also be nice to do the same for task actions and possibly migrations as well.