Skip to content

[DI] Fix false-positive circular exception #25247

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
Dec 1, 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 #25240
License MIT
Doc PR -

@ElectricMaxxx
Copy link
Contributor

With this my 3.4 build would have been red too, right? Or can i reset my "fix" (set the second service to public) now?

@nicolas-grekas
Copy link
Member Author

yes, you can revert your fix

@fabpot
Copy link
Member

fabpot commented Dec 1, 2017

Thank you @nicolas-grekas.

@fabpot fabpot merged commit adf1819 into symfony:3.4 Dec 1, 2017
fabpot added a commit that referenced this pull request Dec 1, 2017
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix false-positive circular exception

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

Commits
-------

adf1819 [DI] Fix false-positive circular exception
@ElectricMaxxx
Copy link
Contributor

Thanks @nicolas-grekas

{
$a = ${($_ = isset($this->services['foo5']) ? $this->services['foo5'] : $this->getFoo5Service()) && false ?: '_'};

if (isset($this->services['bar5'])) {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this come first, before defining the $a variable ?

Copy link
Member

Choose a reason for hiding this comment

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

ah no, understand. This is the call to $this->getFoo5Service() which can register it in $this->services

@nicolas-grekas nicolas-grekas deleted the di-fix-circ branch December 1, 2017 19:31
This was referenced Dec 4, 2017
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.

5 participants