Skip to content

Commit 347d26e

Browse files
committed
minor #52125 [FrameworkBundle] remove the .data_collector.command service if its class does not exist (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [FrameworkBundle] remove the .data_collector.command service if its class does not exist | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT Commits ------- c9123c2 remove the .data_collector.command service if its class does not exist
2 parents 923ecdb + c9123c2 commit 347d26e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
use Symfony\Component\Config\ResourceCheckerInterface;
5151
use Symfony\Component\Console\Application;
5252
use Symfony\Component\Console\Command\Command;
53+
use Symfony\Component\Console\DataCollector\CommandDataCollector;
5354
use Symfony\Component\Console\Debug\CliRequest;
5455
use Symfony\Component\Console\Messenger\RunCommandMessageHandler;
5556
use Symfony\Component\DependencyInjection\Alias;
@@ -917,6 +918,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
917918
if (!$container->getParameter('kernel.debug') || !class_exists(CliRequest::class) || !$container->has('debug.stopwatch')) {
918919
$container->removeDefinition('console_profiler_listener');
919920
}
921+
922+
if (!class_exists(CommandDataCollector::class)) {
923+
$container->removeDefinition('.data_collector.command');
924+
}
920925
}
921926

922927
private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void

0 commit comments

Comments
 (0)