Skip to content

Navigation Menu

Sign in
Appearance settings

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

Commit 2c632f0

Browse filesBrowse files
bug #48606 [FrameworkBundle] container:debug CLI output improvements for excluded services (apfelbox)
This PR was merged into the 6.2 branch. Discussion ---------- [FrameworkBundle] container:debug CLI output improvements for excluded services | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes (not sure) | Deprecations? | no | Tickets | — | License | MIT | Doc PR | — <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Normally I test whether the exclusion rules from the service container of my bundles work correctly by just using the `debug:container` command and looking whether my excluded services occur in the last. However, due to the latest changes in #46279 all services (excluded or not) are always in this list. You need to open the definition to see if it was excluded: ![CleanShot 2022-12-12 at 11 01 08](https://user-images.githubusercontent.com/1032411/207017120-50d3c263-ce7a-4c92-bb7e-8a8f86c47983.png) This PR proposes two things: 1. add a more prominent warning to the service definition details screen that the service is excluded ![CleanShot 2022-12-12 at 11 01 52](https://user-images.githubusercontent.com/1032411/207017261-44495233-f513-4c29-bb6d-469eb0418080.png) (wording tbd) 2. mark the services as excluded in the list (right now by graying them out): ![CleanShot 2022-12-12 at 11 02 44](https://user-images.githubusercontent.com/1032411/207017481-993010da-3364-49dd-b7e0-4f3c07f14ad5.png) If this looks like something you want to include, I will add the "graying out" part to the table view as well. wdyt? Commits ------- 9d2f10f Hide excluded services from container debug list
2 parents c871df8 + 9d2f10f commit 2c632f0
Copy full SHA for 2c632f0

File tree

1 file changed

+3
-0
lines changed
Filter options

1 file changed

+3
-0
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ private function findServiceIdsContaining(ContainerBuilder $builder, string $nam
308308
if (!$showHidden && str_starts_with($serviceId, '.')) {
309309
continue;
310310
}
311+
if (!$showHidden && $builder->hasDefinition($serviceId) && $builder->getDefinition($serviceId)->hasTag('container.excluded')) {
312+
continue;
313+
}
311314
if (false !== stripos(str_replace('\\', '', $serviceId), $name)) {
312315
$foundServiceIdsIgnoringBackslashes[] = $serviceId;
313316
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.