Interface CommandInterface
Describe the interface between a command and the surrounding console libraries.
Namespace: Cake\Console
Method Summary
-
run() public
Run the command.
-
setName() public
Set the name this command uses in the collection.
Generally invoked by the CommandCollection when the command is added. Required to have at least one space in the name so that the root command can be calculated.
Method Detail
run() ¶ public
run(array $argv, Cake\Console\ConsoleIoInterface|null $io = null): int|null
Run the command.
Parameters
-
array$argv Arguments from the CLI environment.
-
Cake\Console\ConsoleIoInterface|null$io optional A custom console io instance if the default one shouldn't be used
Returns
int|nullExit code or null for success.
setName() ¶ public
setName(string $name): $this
Set the name this command uses in the collection.
Generally invoked by the CommandCollection when the command is added. Required to have at least one space in the name so that the root command can be calculated.
Parameters
-
string$name The name the command uses in the collection.
Returns
$this