-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 in debug:container
. The ability to then hide a few of the most internal, is great.
@@ -103,14 +99,18 @@ protected function configure() | ||
*/ | ||
protected function execute(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 ...
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.
@@ -230,27 +231,34 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI | ||
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
to
37054b8
Compare
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
Now that services are private by default, the
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 a new
container.hidden
tag, 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?