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;