Skip to content

Commit bbd806b

Browse files
committed
Nicolas' review
1 parent d996ad9 commit bbd806b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function process(ContainerBuilder $container): void
5353
$invokableRef = new Reference($id);
5454
$definition = $container->register($id .= '.command', $class = Command::class)
5555
->addMethodCall('setCode', [$invokableRef]);
56+
} else {
57+
$invokableRef = null;
5658
}
5759

5860
$aliases = $tags[0]['command'] ?? str_replace('%', '%%', $class::getDefaultName() ?? '');
@@ -105,7 +107,7 @@ public function process(ContainerBuilder $container): void
105107
$definition->addMethodCall('setHidden', [true]);
106108
}
107109

108-
if ($help && isset($invokableRef)) {
110+
if ($help && $invokableRef) {
109111
$definition->addMethodCall('setHelp', [str_replace('%', '%%', $help)]);
110112
}
111113

0 commit comments

Comments
 (0)