Method | Description | |
---|---|---|
__construct ( |
Creates a new command. | |
getAliases ( ) : string[] | Returns the alias names of the command. | |
getApplication ( ) : Webmozart\Console\Api\Application\Application | Returns the console application. | |
getArgsFormat ( ) : |
Returns the arguments format of the command. | |
getConfig ( ) : |
Returns the configuration of the command. | |
getDefaultSubCommands ( ) : |
Returns the commands that should be executed if no explicit command is passed. | |
getName ( ) : string | Returns the name of the command. | |
getNamedSubCommands ( ) : |
Returns all sub-commands that are not anonymous. | |
getParentCommand ( ) : |
Returns the parent command. | |
getShortName ( ) : string | null | Returns the short name of the command. | |
getSubCommand ( string $name ) : |
Returns the sub-command with a specific name. | |
getSubCommands ( ) : |
Returns all sub-commands of the command. | |
handle ( |
Executes the command for the given parsed arguments. | |
hasAliases ( ) : boolean | Returns whether the command has aliases. | |
hasDefaultSubCommands ( ) : boolean | Returns whether the command has any default commands. | |
hasNamedSubCommands ( ) : boolean | Returns whether the command has any commands that are not anonymous. | |
hasSubCommand ( string $name ) : boolean | Returns whether a sub-command with the given name exists. | |
hasSubCommands ( ) : boolean | Returns whether the command has any sub-commands. | |
parseArgs ( Webmozart\Console\Api\Args\RawArgs $args, boolean $lenient = null ) : |
Parses the raw console arguments and returns the parsed arguments. | |
run ( Webmozart\Console\Api\Args\RawArgs $args, |
Executes the command for the given unparsed arguments. |
Method | Description | |
---|---|---|
addSubCommand ( |
Adds a sub-command. | |
doHandle ( |
||
getBaseFormat ( ) : |
Returns the inherited arguments format of the command. | |
validateSubCommandName ( |
||
warnIfProcessTitleNotSupported ( $processTitle, |
public __construct ( |
||
$config | The command configuration. | |
$application | Webmozart\Console\Api\Application\Application | The console application. |
$parentCommand | The parent command. |
public getAliases ( ) : string[] | ||
return | string[] | An array of alias names of the command. |
public getApplication ( ) : Webmozart\Console\Api\Application\Application | ||
return | Webmozart\Console\Api\Application\Application | The console application. |
public getArgsFormat ( ) : |
||
return | The input definition. |
public getConfig ( ) : |
||
return | The command configuration. |
public getDefaultSubCommands ( ) : |
||
return | The default commands. |
public getNamedSubCommands ( ) : |
||
return | The named commands. |
public getParentCommand ( ) : |
||
return | The parent command. |
public getShortName ( ) : string | null | ||
return | string | null | The short name or `null` if the command is not an option command. |
public getSubCommand ( string $name ) : |
||
$name | string | The name of the sub-command. |
return | The sub-command. |
public getSubCommands ( ) : |
||
return | The sub-commands. |
public hasAliases ( ) : boolean | ||
return | boolean | Returns `true` if the command has aliases and `false` otherwise. |
public hasDefaultSubCommands ( ) : boolean | ||
return | boolean | Returns `true` if the command has default commands and `false` otherwise. |
public hasNamedSubCommands ( ) : boolean | ||
return | boolean | Returns `true` if the command has named commands and `false` otherwise. |
public hasSubCommand ( string $name ) : boolean | ||
$name | string | The name of the sub-command. |
return | boolean | Returns `true` if a sub-command with that name exists and `false` otherwise. |
public hasSubCommands ( ) : boolean | ||
return | boolean | Returns `true` if the command has sub-commands and `false` otherwise. |
public parseArgs ( Webmozart\Console\Api\Args\RawArgs $args, boolean $lenient = null ) : |
||
$args | Webmozart\Console\Api\Args\RawArgs | The raw console arguments. |
$lenient | boolean | Whether the parser should ignore parse errors. If `true`, the parser will not throw any exceptions when parse errors occur. |
return | The parsed console arguments. |