Skip to content

Commit c7a52f3

Browse files
committed
fix error
1 parent 3512f78 commit c7a52f3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Application.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,17 @@ public function command(string $name, $handler = null, $option = null)
130130
return $this;
131131
}
132132

133+
// allow define aliases in Command class by Command::aliases()
134+
if ($aliases = $handler::aliases()) {
135+
$option['aliases'] = isset($option['aliases']) ? \array_merge($option['aliases'], $aliases) : $aliases;
136+
}
133137
} elseif (!\is_object($handler) || !\method_exists($handler, '__invoke')) {
134138
Helper::throwInvalidArgument(
135139
'The console command handler must is an subclass of %s OR a Closure OR a object have method __invoke()',
136140
Command::class
137141
);
138142
}
139143

140-
// allow define aliases in Command class by Command::aliases()
141-
if ($aliases = $handler::aliases()) {
142-
$option['aliases'] = isset($option['aliases']) ? \array_merge($option['aliases'], $aliases) : $aliases;
143-
}
144-
145144
// is an class name string
146145
$this->commands[$name] = $handler;
147146

0 commit comments

Comments
 (0)