From ab5cab163e0e8daa63242d8918d4115701c7c0af Mon Sep 17 00:00:00 2001 From: Julien Rosset Date: Wed, 30 Oct 2024 11:33:21 +0100 Subject: [PATCH] BaseCommand : fix default name when using CliCommand --- src/CliProgram/BaseCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CliProgram/BaseCommand.php b/src/CliProgram/BaseCommand.php index 4743488..b0de214 100644 --- a/src/CliProgram/BaseCommand.php +++ b/src/CliProgram/BaseCommand.php @@ -21,7 +21,9 @@ class BaseCommand extends Command { if ($attribute = $reflectionClass->getAttributes(CliCommand::class)) { /** @var CliCommand $cliCommandAttribute */ $cliCommandAttribute = $attribute[0]->newInstance(); - return $cliCommandAttribute->name; + if ($cliCommandAttribute->name !== null) { + return $cliCommandAttribute->name; + } } if (($name = parent::getDefaultName()) !== null) { return $name;