Skip to content

[DI] Fix anonymous factories/configurators support #22279

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

Closed
wants to merge 2 commits into from

Conversation

GuilhemN
Copy link
Contributor

@GuilhemN GuilhemN commented Apr 4, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21999 (comment)
License MIT
Doc PR

Using prototypes / instanceof conditionals, anonymous factories are inlined using Definition, so a new instance will be created for every service created from the prototype / conditional which is inconsistent with the way other anonymous services are managed.

@@ -261,9 +261,7 @@ private function parseDefinition(\DOMElement $service, $file, array $defaults =
} else {
$factoryService = $this->getChildren($factory, 'service');
Copy link
Member

@nicolas-grekas nicolas-grekas Apr 5, 2017

Choose a reason for hiding this comment

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

why keep this line? was is useless?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a mistake :) Thanks !

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Apr 5, 2017
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

@fabpot
Copy link
Member

fabpot commented Apr 5, 2017

Thank you @GuilhemN.

@fabpot fabpot closed this in 958b0ae Apr 5, 2017
@GuilhemN GuilhemN deleted the FACTORY branch April 5, 2017 13:17
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.

4 participants