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