Skip to content

Commit 8496ef4

Browse files
authored
Merge pull request #49 from krissss/patch-1
Fix setDescription cant be null
2 parents 2d4ce52 + 82c42ae commit 8496ef4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Command.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ public function createCommandInstance($class_name)
6060
if (!$name) {
6161
throw new RuntimeException("Command {$class_name} has no defaultName");
6262
}
63-
$description = $properties['defaultDescription'] ?? '';
63+
$description = $properties['defaultDescription'] ?? null;
6464
}
6565
$command = Container::get($class_name);
66-
$command->setName($name)->setDescription($description);
66+
$command->setName($name);
67+
if ($description) {
68+
$command->setDescription($description);
69+
}
6770
$this->add($command);
6871
return $command;
6972
}
70-
}
73+
}

0 commit comments

Comments
 (0)