Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
nicolas-grekas merged 1 commit intosymfony:masterfromchalasr:fix-slocator-setval
Feb 28, 2017

Conversation

@chalasr
Copy link
Member

QA
Branch?master
Fixed tickets#21625 (comment)
Tests pass?yes
LicenseMIT

ResolveInvalidReferencesPasscallssetValues() with resolved invalid reference (null), theReference type check should occurs at construction only.

@stof
Copy link
Member

hmm, we should still allow onlyReference|null in the setter

@chalasrchalasrforce-pushed thefix-slocator-setval branch 3 times, most recently fromd23c60c to2535108CompareFebruary 28, 2017 08:59
@chalasr
Copy link
MemberAuthor

@stof fixed

{
foreach ($valuesas$v) {
if (!$vinstanceof Reference) {
if (!$vinstanceof Reference &&null !==$v) {

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?

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?

chalasr reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Test case added

@chalasrchalasrforce-pushed thefix-slocator-setval branch 2 times, most recently fromb71b4db toae18b79CompareFebruary 28, 2017 09:30
@chalasr
Copy link
MemberAuthor

Build failure unrelated.

@nicolas-grekas
Copy link
Member

Thank you@chalasr.

@nicolas-grekasnicolas-grekas merged commit256b836 intosymfony:masterFeb 28, 2017
nicolas-grekas added a commit that referenced this pull requestFeb 28, 2017
…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
@chalasrchalasr deleted the fix-slocator-setval branchFebruary 28, 2017 12:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@chalasr@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp