Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI] Fix ServiceLocatorArgument::setValues() for non-reference values#21794
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedFeb 28, 2017
hmm, we should still allow only |
d23c60c to2535108Comparechalasr commentedFeb 28, 2017
@stof fixed |
| { | ||
| foreach ($valuesas$v) { | ||
| if (!$vinstanceof Reference) { | ||
| if (!$vinstanceof Reference &&null !==$v) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nulls will create services that have "has()" return true, and "get()" return null. Not sure it's useful at all. What about skipping them instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Self answer: bad idea: maybe the consumer expects a value from get for the provided key. :)
Test case missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Test case added
b71b4db toae18b79Compareae18b79 to256b836Comparechalasr commentedFeb 28, 2017
Build failure unrelated. |
nicolas-grekas commentedFeb 28, 2017
Thank you@chalasr. |
…ence values (chalasr)This PR was merged into the 3.3-dev branch.Discussion----------[DI] Fix ServiceLocatorArgument::setValues() for non-reference values| Q | A| ------------- | ---| Branch? | master| Fixed tickets |#21625 (comment)| Tests pass? | yes| License | MIT`ResolveInvalidReferencesPass` [calls `setValues()`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php#L91) with resolved invalid reference (null), the `Reference` type check should occurs at construction only.Commits-------256b836 [DI] Fix ServiceLocatorArgument::setValues() for non-reference values
ResolveInvalidReferencesPasscallssetValues()with resolved invalid reference (null), theReferencetype check should occurs at construction only.