Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Allow RuntimeDefinition to still process explicit classes #5609

Conversation

nickpeirson
Copy link
Contributor

Prior to this commit, explicit classes passed to a Di RuntimeDefinition would not be processed as they already existed in the classes array. This behaviour doesn't match the documentation, which suggests that defining explicit classes provides functionality to apply different introspection strategies to different sets of classes. As we'd like the documented behaviour, I'm in favour of fixing the implementation rather than the documentation. Without the fix, defining explicitClasses seems to offer the same behaviour as an ArrayDefinition. This commit adds tests to demonstrate the problem and changes to implement the desired behaviour.

It also consolidates the check to see if a class has already been processed at the cost of adding a flag to processClass.

Prior to this commit, explicit classes passed to a Di RuntimeDefinition would not be processed as the already existed in the class array. This behaviour doesn't match the documentation which suggests that explicit classes provides functionality to apply different introspection strategies to different sets of classes. This commit adds tests to demonstrate this and changes to fix the behaviour
@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014
@weierophinney weierophinney self-assigned this Mar 3, 2014
weierophinney added a commit that referenced this pull request Mar 3, 2014
Allow RuntimeDefinition to still process explicit classes
weierophinney added a commit that referenced this pull request Mar 3, 2014
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
…DiRuntimeDef-ExplicitClasses

Allow RuntimeDefinition to still process explicit classes
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants