Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI][FrameworkBundle] Use container.hidden tag to hide services from debug:container#26891
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
weaverryan left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Obviously, you know I like this idea. Particularly, it's important to now show ALL services indebug:container. The ability to then hide a few of themost internal, is great.
| protectedfunctionexecute(InputInterface$input,OutputInterface$output) | ||
| { | ||
| if ($input->getOption('show-private')) { | ||
| @trigger_error('The "--show-private" option is a no-op and is deprecated since Symfony 4.1.',E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
option no longer has any effect and is deprecated ...
stof left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The new tag must be added in the whitelist of the UnusedTags pass, to avoid complaining about this tag not being during the container building.
| return$builder->getAlias($serviceId); | ||
| } | ||
| if ('service_container' ==$serviceId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should use a strict comparison
c1d7918 to37054b8Comparenicolas-grekas commentedApr 13, 2018
Replaced by#26921 |
… a dot (nicolas-grekas)This PR was merged into the 4.1-dev branch.Discussion----------[DI][FrameworkBundle] Hide service ids that start with a dot| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets |#26630| License | MIT| Doc PR | -Now that services are private by default, `debug:container` should display them by default.In fact, the public/private concept should not trigger a difference in visibility for this command.Instead, I propose to handle service ids that start with a dot as hidden services.PR should be ready.(For reference, I tried using a tag instead in#26891, but that doesn't work in practice when working on the implementation.)Commits-------cea051e [DI][FrameworkBundle] Hide service ids that start with a dot
Uh oh!
There was an error while loading.Please reload this page.
Now that services are private by default, the
debug:containershould display them by default.In fact, the public/private concept should not trigger a difference in visibility for this command.
Instead, I propose to handle a new
container.hiddentag, for the purpose of tagging services as hidden (~internal).I now need to apply the tag to more services created internally.
Any comments at this stage?