Skip to content

[DependencyInjection] resolve aliases in factories #17554

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
Jan 27, 2016

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jan 27, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets FriendsOfSymfony/FOSUserBundle#2048
License MIT
Doc PR

private function processFactory($factory)
{
if (null === $factory || !is_array($factory) || !$factory[0] instanceof Reference) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

this needs to return the factory

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, fixed

@xabbuh xabbuh force-pushed the resolve-factory-alias-2.7 branch from 33e0669 to fde10e7 Compare January 27, 2016 09:00
$defId = $this->getDefinitionId($id = (string) $factory[0]);

if ($defId !== $id) {
$factory[0] = new Reference($defId, $factory[0]->getInvalidBehavior(), $factory[0]->isStrict());
Copy link
Member

Choose a reason for hiding this comment

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

note that this line will need changes when merging into 2.8 (and then again in 3.0) due to changes to isStrict

@stof
Copy link
Member

stof commented Jan 27, 2016

👍

@stof
Copy link
Member

stof commented Jan 27, 2016

Status: reviewed

@fabpot
Copy link
Member

fabpot commented Jan 27, 2016

Thank you @xabbuh.

@fabpot fabpot merged commit fde10e7 into symfony:2.7 Jan 27, 2016
fabpot added a commit that referenced this pull request Jan 27, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] resolve aliases in factories

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | FriendsOfSymfony/FOSUserBundle#2048
| License       | MIT
| Doc PR        |

Commits
-------

fde10e7 resolve aliases in factories
@fabpot
Copy link
Member

fabpot commented Jan 27, 2016

@xabbuh Can I let you merge 2.3 into 2.7, 2.7 into 2.8, and 2.8 into 3.0? This should be easy as I've done the merge not too long ago.

@xabbuh xabbuh deleted the resolve-factory-alias-2.7 branch January 27, 2016 10:41
@xabbuh
Copy link
Member Author

xabbuh commented Jan 27, 2016

@fabpot sure, did so

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