-
-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support references to arbitrary container entries for factory definitions #321
Conversation
👍 However is the change (current state of the PR) necessary? |
Oh, I didn't know that this is possible! You are right, But this change uses the container for callable resolution, too, which enables you to use any container entry name for the first part and thus allows something like: |
I just looked at the documentation where it says This is actually not possible at the moment and would only be possible with the changes in this PR, too. |
Mhh yeah that's true, 2 good points! I can't believe I didn't add tests in #308… |
a2ca7d8
to
30162f3
Compare
Added some unit tests that cover factory definitions that reference container entries. Tests for |
Changed name and description of this PR to what it actually does. |
makes sense to me, yep. |
…llable This is needed if the factory definition references a container entry.
…entry names for factories
82440df
to
cb87e18
Compare
Added some documentation (please tell me if you have suggestions for improvements on this :). |
This is the cleanest pull request ever! Tests, docs, changelog! That rocks :) |
Support references to arbitrary container entries for factory definitions
Currently, references to container entries in factory definitions are only possible, if they reference a class that actually exist with this exact FQN.
This PR enables you to to reference arbitrary container entries in factory definitions (as long as they are callables, of course), for example:
factory('my.closure')
factory('my.invocable.object')
factory(['my.class', 'method'])
Todo:
Closes #272