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

[DependencyInjection] check for circular refs caused by method calls#21436

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
fabpot merged 1 commit intosymfony:2.7fromxabbuh:issue-19362
Feb 16, 2017

Conversation

@xabbuh
Copy link
Member

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#19362
LicenseMIT
Doc PR

Before we check for circular references, dependencies coming from method calls are not part of the dependency graph. That why the pass is not able to detect circular references like the one described in#19362 during compilation of the container.

If we add another check after all the optimisation passes have been processed, we should be able to detect these circular references too.

@stof
Copy link
Member

Clearly not acceptable without tests

@xabbuh
Copy link
MemberAuthor

@stof Sure, I just wanted to make sure first that there is no reason I did not think of that this is a stupid solution.

@xabbuhxabbuhforce-pushed theissue-19362 branch 2 times, most recently from20670f6 toee5881bCompareJanuary 27, 2017 18:16
@stof
Copy link
Member

Please add a test ensuring that circular references in method calls stay allowed when inlining the services (i.e. we can instantiate both objects and then make method calls on them before leaving theget*Service method)

@xabbuh
Copy link
MemberAuthor

@stof Not sure I understand what you mean. Do you have an example of what you have in mind?

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneJan 29, 2017
;
$container
->register('baz','Baz')
->addMethodCall('setFoo',array(newReference('foo_with_inline')))
Copy link
Member

Choose a reason for hiding this comment

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

Why removing this ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Readding the method call leads to a circular reference detected by the added pass (foo_with_inline ->inlined ->baz ->foo_with_inline).

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commitfe4f7ec intosymfony:2.7Feb 16, 2017
fabpot added a commit that referenced this pull requestFeb 16, 2017
…thod calls (xabbuh)This PR was merged into the 2.7 branch.Discussion----------[DependencyInjection] check for circular refs caused by method calls| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19362| License       | MIT| Doc PR        |Before we check for circular references, dependencies coming from method calls are not part of the dependency graph. That why the pass is not able to detect circular references like the one described in#19362 during compilation of the container.If we add another check after all the optimisation passes have been processed, we should be able to detect these circular references too.Commits-------fe4f7ec check for circular refs caused by method calls
@fabpot
Copy link
Member

@xabbuh Can you have a look at the master branch as it breakscontainer29.php, which is legitimate. So, maybe, it's more complex than this PR.

@xabbuhxabbuh deleted the issue-19362 branchFebruary 16, 2017 16:27
@xabbuh
Copy link
MemberAuthor

I am looking into it.

@fabpotfabpot mentioned this pull requestFeb 16, 2017
@fabpot
Copy link
Member

@xabbuh What about reverting it for now?

@xabbuh
Copy link
MemberAuthor

@fabpot Fine for me. I try to fix the tests tomorrow and can resubmit this PR then if you agree.

fabpot added a commit that referenced this pull requestFeb 16, 2017
…ed by method calls (xabbuh)"This reverts commit3441b15, reversingchanges made tod1f4cb2.
@fabpot
Copy link
Member

ok, reverted for now, until we have a fix for the issue on master.

fabpot added a commit that referenced this pull requestFeb 16, 2017
* 2.7:  Revert "bug#21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"  Static code analysis with Php Inspections (EA Extended)  [VarDumper] Added missing persistent stream cast
fabpot added a commit that referenced this pull requestFeb 16, 2017
* 2.8:  Revert "bug#21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"  Static code analysis with Php Inspections (EA Extended)  [VarDumper] Added missing persistent stream cast
fabpot added a commit that referenced this pull requestFeb 16, 2017
* 3.2:  Revert "bug#21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"  Static code analysis with Php Inspections (EA Extended)  [VarDumper] Added missing persistent stream cast  remove unused translation file  reverted usage of isNan
@fabpotfabpot mentioned this pull requestFeb 17, 2017
@xabbuh
Copy link
MemberAuthor

Resubmitted in#21642 (I opened the PR againstmaster first to prove that checks now pass with the changes from#21639, seehttps://travis-ci.org/symfony/symfony/builds/202523603).

@stof
Copy link
Member

@fabpot this PR has been reverted, but the revert is not part of the release. Should we do another set of releases including it rather than waiting 1 month with releases breaking existing projects ?

@xabbuh
Copy link
MemberAuthor

@stof68d6415 is part of the 3.2.4 release.

@xabbuh
Copy link
MemberAuthor

The changelog is misleading as it doesn't consider the revert.

@stof
Copy link
Member

well, this explains it.

This was referencedMar 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

5 participants

@xabbuh@stof@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp