Skip to content
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

[DI] Detect circular references with ChildDefinition parent #28480

Merged
merged 1 commit into from Sep 18, 2018

Conversation

Projects
None yet
4 participants
@Seb33300
Copy link
Contributor

commented Sep 16, 2018

Q A
Branch? 3.4 (be careful when merging)
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #28312
License MIT
Doc PR

I will provide a test case if the fix looks good for you :)

@Seb33300

This comment has been minimized.

Copy link
Contributor Author

commented Sep 16, 2018

Oups, didn't see that someone already worked on it: #28452

@Seb33300

This comment has been minimized.

Copy link
Contributor Author

commented Sep 16, 2018

Just pushed a test case since it looks to be the good way to fix this issue regarding comments on the other pull request.

I pushed on master because it is a very similar issue as the previous one I fixed (#28315) which was merged on master.

@@ -396,4 +396,20 @@ protected function process(ContainerBuilder $container)
$pass = new ResolveChildDefinitionsPass();
$pass->process($container);
}
/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Sep 17, 2018

Member

could be worth adding an @expectedExceptionMessage: right now, I get: Service "a": Service "a": Service "a": Service "a": Circular reference detected for service "c", path: "c -> b -> a -> c"., which might need some tweaks :)

This comment has been minimized.

Copy link
@stof

stof Sep 17, 2018

Member

hmm, that's resolveDefinition prefixing the exception message. And the multiple prefixing looks really weird though.

This comment has been minimized.

Copy link
@Seb33300

Seb33300 Sep 17, 2018

Author Contributor

Oups, didn't see that. I just pushed a fix.

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Sep 17, 2018

Member

still worth adding @expectedExceptionMessage :)

This comment has been minimized.

Copy link
@Seb33300

Seb33300 Sep 17, 2018

Author Contributor

Maybe @expectedExceptionMessageRegExp to test if exception message is not prefixed?

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Sep 17, 2018

(for 3.4!)

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Sep 17, 2018

@stof

stof approved these changes Sep 18, 2018

@nicolas-grekas nicolas-grekas changed the base branch from master to 3.4 Sep 18, 2018

@nicolas-grekas nicolas-grekas force-pushed the Seb33300:patch-2 branch from 8627b2d to 2a59c8e Sep 18, 2018

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Sep 18, 2018

Thank you @Seb33300.

@nicolas-grekas nicolas-grekas merged commit 2a59c8e into symfony:3.4 Sep 18, 2018

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Sep 18, 2018

bug #28480 [DI] Detect circular references with ChildDefinition paren…
…t (Seb33300)

This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #28480).

Discussion
----------

[DI] Detect circular references with ChildDefinition parent

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (be careful when merging)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28312
| License       | MIT
| Doc PR        |

I will provide a test case if the fix looks good for you :)

Commits
-------

2a59c8e [DI] Detect circular references with ChildDefinition parent

@Seb33300 Seb33300 deleted the Seb33300:patch-2 branch Sep 18, 2018

This was referenced Sep 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.