Skip to content

[DI] Analyze setter-circular deps more precisely #25055

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #24950
License MIT
Doc PR -

This PR reverts the effect of #24828 and #24822 on fixtures, except for the new behavior these PRs introduced, which was mostly fine, but missed a few cases.
This PR now uses the reference graph to precisely decide which services need circular dependency care, and does not touch the other ones.

@@ -562,15 +600,15 @@ private function isTrivialInstance(Definition $definition)
}

foreach ($definition->getArguments() as $arg) {
if (!$arg || ($arg instanceof Reference && 'service_container' === (string) $arg)) {
if (!$arg) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this just removes useless logic that is already handled below in the method

@nicolas-grekas nicolas-grekas merged commit 9cc4a21 into symfony:3.4 Nov 20, 2017
nicolas-grekas added a commit that referenced this pull request Nov 20, 2017
…grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Analyze setter-circular deps more precisely

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24950
| License       | MIT
| Doc PR        | -

This PR reverts the effect of #24828 and #24822 on fixtures, except for the new behavior these PRs introduced, which was mostly fine, but missed a few cases.
This PR now uses the reference graph to precisely decide which services need circular dependency care, and does not touch the other ones.

Commits
-------

9cc4a21 [DI] Analyze setter-circular deps more precisely
This was referenced Nov 21, 2017
@nicolas-grekas nicolas-grekas deleted the di-circular-deps branch November 23, 2017 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants