Méthode | Description | |
---|---|---|
__construct ( |
Creates the console arguments. | |
addArguments ( array $arguments ) : static | Sets the values of multiple arguments. | |
addOptions ( array $options ) : static | Sets the values of multiple options. | |
getArgument ( string | integer $name ) : mixed | Returns the value of an argument. | |
getArguments ( boolean $includeDefaults = true ) : array | Returns the values of all arguments. | |
getCommandNames ( ) : |
Returns the command names as array. | |
getCommandOptions ( ) : |
Returns the command options as array. | |
getFormat ( ) : |
Returns the format of the console arguments. | |
getOption ( string $name ) : mixed | Returns an option. | |
getOptions ( boolean $includeDefaults = true ) : array | Returns all options. | |
getRawArgs ( ) : Webmozart\Console\Api\Args\RawArgs | Returns the raw console arguments. | |
getScriptName ( ) : string | null | Returns the PHP script as it was called on the console. | |
isArgumentDefined ( string | integer $name ) : boolean | Returns whether an argument is defined in the format. | |
isArgumentSet ( string | integer $name ) : boolean | Returns whether an argument is set. | |
isOptionDefined ( string $name ) : boolean | Returns whether an option is defined in the format. | |
isOptionSet ( string $name ) : boolean | Returns whether an option is set. | |
setArgument ( string | integer $name, mixed $value ) : static | Sets the value of an argument. | |
setArguments ( array $arguments ) : static | Sets the values of multiple arguments. | |
setOption ( string $name, mixed $value = true ) : static | Sets an option. | |
setOptions ( array $options ) : static | Sets the values of multiple options. |
public __construct ( |
||
$format | The format that the arguments and options must adhere to. | |
$rawArgs | Webmozart\Console\Api\Args\RawArgs | The raw console arguments. |
public addArguments ( array $arguments ) : static | ||
$arguments | array | The argument values indexed by the argument names or their 0-based positions in the argument list. |
Résultat | static | The current instance. |
public addOptions ( array $options ) : static | ||
$options | array | The options indexed by their long or short names and their values. |
Résultat | static | The current instance. |
public getArguments ( boolean $includeDefaults = true ) : array | ||
$includeDefaults | boolean | Whether to return the default values for arguments that were not set. |
Résultat | array | The argument values. |
public getCommandNames ( ) : |
||
Résultat | The command names. |
public getCommandOptions ( ) : |
||
Résultat | The command options. |
public getFormat ( ) : |
||
Résultat | The format. |
public getOptions ( boolean $includeDefaults = true ) : array | ||
$includeDefaults | boolean | Whether to return the default values for options that were not set. |
Résultat | array | The option values and `true`/`false` for options without values. |
public getRawArgs ( ) : Webmozart\Console\Api\Args\RawArgs | ||
Résultat | Webmozart\Console\Api\Args\RawArgs | The raw arguments. |
public getScriptName ( ) : string | null | ||
Résultat | string | null | The script name or null if no script name is available. |
public isOptionDefined ( string $name ) : boolean | ||
$name | string | The long or short option name. |
Résultat | boolean | Returns `true` if the option exists and `false` otherwise. |
public isOptionSet ( string $name ) : boolean | ||
$name | string | The long or short option name. |
Résultat | boolean | Returns `true` if the option is set and `false` otherwise. |
public setArguments ( array $arguments ) : static | ||
$arguments | array | The argument values indexed by the argument names or their 0-based positions in the argument list. |
Résultat | static | The current instance. |
public setOptions ( array $options ) : static | ||
$options | array | The options indexed by their long or short names and their values. |
Résultat | static | The current instance. |