8000 bug #35247 [FrameworkBundle][ContainerLintCommand] Only skip .errored… · symfony/symfony@6eb024b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6eb024b

Browse files
committed
bug #35247 [FrameworkBundle][ContainerLintCommand] Only skip .errored. services (fancyweb)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle][ContainerLintCommand] Only skip .errored. services | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This PR partially reverts #34935 that was a kind of a mistake. Skipping all removed ids cannot work because all private services are in the "removed" ids. So the command ends up not validating much. To still fix the original issue #34858 we need to skip errored services. However, definition errors are not dumped / read (see #34928). So instead, even if it's bad, we can maybe rely on the name for this particular error since it's hardcoded 😕 At least it fixes this case in a simple way 😕 Commits ------- d38cdc9 [FrameworkBundle][ContainerLintCommand] Only skip .errored. services
2 parents ffd5d12 + d38cdc9 commit 6eb024b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ private function getContainerBuilder(): ContainerBuilder
102102
$refl->setAccessible(true);
103103
$refl->setValue($parameterBag, true);
104104

105-
$passConfig = $container->getCompilerPassConfig();
106-
$passConfig->setRemovingPasses([]);
107-
$passConfig->setAfterRemovingPasses([]);
108-
109-
$skippedIds = $kernelContainer->getRemovedIds();
105+
$skippedIds = [];
106+
foreach ($container->getServiceIds() as $serviceId) {
107+
if (0 === strpos($serviceId, '.errored.')) {
108+
$skippedIds[$serviceId] = true;
109+
}
110+
}
110111
}
111112

112113
$container->setParameter('container.build_hash', 'lint_container');

0 commit comments

Comments
 (0)
0