Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Closed

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Apr 11, 2018

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, 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?

Copy link
Member

@weaverryan weaverryan left a 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);
Copy link
Member

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 ...

Copy link
Member

@stof stof left a 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) {
Copy link
Member

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

@nicolas-grekas
Copy link
Member Author

Replaced by #26921

fabpot added a commit that referenced this pull request Apr 20, 2018
… 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
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.