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

[Advanced DI] Short guide on how to make a service alias private #5138

Closed
linaori opened this issue Apr 3, 2015 · 4 comments
Closed

[Advanced DI] Short guide on how to make a service alias private #5138

linaori opened this issue Apr 3, 2015 · 4 comments
Labels
actionable Clear and specific issues ready for anyone to take them. DependencyInjection good first issue Ideal for your first contribution! (some Symfony experience may be required)

Comments

@linaori
Copy link
Contributor

linaori commented Apr 3, 2015

A colleague of mine was looking for a way to make an alias private due to the nature of how privates work, the original services are private too. He managed to trace back in the code that there's a secondary way of defining the Alias; By using Symfony\Component\DependencyInjection\Alias::__construct($id, $public = true).

An example can be found in the Doctrine bundle (DoctrineExtension.php): $container->setAlias($aliasId, new Alias($serviceId, false));. I think this would be a useful and easy feature to document.

@xabbuh xabbuh added good first issue Ideal for your first contribution! (some Symfony experience may be required) Doc Request actionable Clear and specific issues ready for anyone to take them. DependencyInjection labels Apr 3, 2015
@wouterj
Copy link
Member

wouterj commented Apr 3, 2015

In order for this to be an easy pick, we have to show where to put this information.

For now, this can be added to components/dependency_injection/advanced.rst. But I'd like to revisit that article in the future (#4228).

@linaori
Copy link
Contributor Author

linaori commented Apr 3, 2015

I think that for now, it could just be a small paragraph below the current Alias and be taken along when the section is revised.

@javiereguiluz javiereguiluz added the hasPR A Pull Request has already been submitted for this issue. label Jan 18, 2017
@javiereguiluz javiereguiluz removed the hasPR A Pull Request has already been submitted for this issue. label Jul 20, 2017
@javiereguiluz
Copy link
Member

@iltar is this 3-year old issue still relevant after all change sin the DI component? Thanks.

@linaori
Copy link
Contributor Author

linaori commented Dec 10, 2017

Not entirely sure, but I don't see others asking for the feature so I suppose we can close it 👍

@linaori linaori closed this as completed Dec 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. DependencyInjection good first issue Ideal for your first contribution! (some Symfony experience may be required)
Projects
None yet
Development

No branches or pull requests

4 participants