Allow spaces instead of underscores for new migration command.
This commit is contained in:
parent
737be27198
commit
94b8efb6f4
2 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue