Skip to content

Commit af71efe

Browse files
committed
[FrameworkBundle] fix removing commands if console not available
1 parent 98edf9c commit af71efe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function load(array $configs, ContainerBuilder $container)
390390
if ($this->readConfigEnabled('mailer', $container, $config['mailer'])) {
391391
$this->registerMailerConfiguration($config['mailer'], $container, $loader);
392392

393-
if (!class_exists(MailerTestCommand::class) || !$this->hasConsole()) {
393+
if (!$this->hasConsole() || !class_exists(MailerTestCommand::class)) {
394394
$container->removeDefinition('console.command.mailer_test');
395395
}
396396
}
@@ -1971,7 +1971,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
19711971
throw new LogicException('Messenger support cannot be enabled as the Messenger component is not installed. Try running "composer require symfony/messenger".');
19721972
}
19731973

1974-
if (!class_exists(StatsCommand::class)) {
1974+
if (!$this->hasConsole() || !class_exists(StatsCommand::class)) {
19751975
$container->removeDefinition('console.command.messenger_stats');
19761976
}
19771977

0 commit comments

Comments
 (0)