8000 bug #41747 [Security] Fixed 'security.command.debug_firewall' not fou… · symfony/symfony@6b1f17f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b1f17f

Browse files
committed
bug #41747 [Security] Fixed 'security.command.debug_firewall' not found (Nyholm)
This PR was merged into the 5.3 branch. Discussion ---------- [Security] Fixed 'security.command.debug_firewall' not found | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | When working on a bundle that depends on some `symfony/security-bundle`, I found this. Basically, we assume that service `security.command.debug_firewall` is always defined. For most application this service is defined as it is defined if `symfony/console` is installed. This is why we never caught the bug before. But I do run into issues when I run the tests for my bundle. Commits ------- de60ca4 Service 'security.command.debug_firewall' is only available if symfony/console is installed
2 parents fe366a0 + de60ca4 commit 6b1f17f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,10 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
529529
$listeners[] = new Reference('security.firewall.authenticator.'.$id);
530530

531531
// Add authenticators to the debug:firewall command
532-
$debugCommand = $container->getDefinition('security.command.debug_firewall');
533-
$debugCommand->replaceArgument(3, array_merge($debugCommand->getArgument(3), [$id => $authenticators]));
532+
if ($container->hasDefinition('security.command.debug_firewall')) {
533+
$debugCommand = $container->getDefinition('security.command.debug_firewall');
534+
$debugCommand->replaceArgument(3, array_merge($debugCommand->getArgument(3), [$id => $authenticators]));
535+
}
534536
}
535537

536538
$config->replaceArgument(7, $configuredEntryPoint ?: $defaultEntryPoint);

0 commit comments

Comments
 (0)
0