Allow RuntimeDefinition to still process explicit classes #5609

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@nickpeirson
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.

@nickpeirson nickpeirson Allow RuntimeDefinition to still process explicit classes
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
2b6a2f9
@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014
@weierophinney weierophinney self-assigned this Mar 3, 2014
@weierophinney weierophinney added a commit that closed this pull request Mar 3, 2014
@weierophinney weierophinney Merge branch 'hotfix/5609'
Close #5609
d565ef5
@weierophinney weierophinney added a commit that referenced this pull request Mar 3, 2014
@weierophinney weierophinney Merge branch 'hotfix/5609' into develop
Forward port #5609
c3b2a5f
@weierophinney weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#5609 from nickpeirson/…
…DiRuntimeDef-ExplicitClasses

Allow RuntimeDefinition to still process explicit classes
1888379
@weierophinney weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5609' fd829f5
@weierophinney weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5609' into develop 5e107dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment