Allow spaces instead of underscores for new migration command.

This commit is contained in:
flash 2020-05-27 13:47:52 +00:00
parent 737be27198
commit 94b8efb6f4
2 changed files with 6 additions and 2 deletions

View file

@ -9,7 +9,11 @@ class CommandArgs {
}
public function getArgs(): array {
return $this->args;
return array_slice($this->args, 2);
}
public function getArgCount(): int {
return count($this->args) - 2;
}
public function getCommand(): string {

View file

@ -33,7 +33,7 @@ MIG;
}
public function dispatch(CommandArgs $args): void {
$name = trim($args->getArg(0));
$name = str_replace(' ', '_', implode(' ', $args->getArgs()));
if(empty($name)) {
echo 'Specify a migration name.' . PHP_EOL;