PHP Class Webmozart\Console\Api\Args\Format\CommandOption

The command names and command options determine which command is executed. In the example below, the console arguments contain the command name "server" and the command option "delete": $ console server --delete localhost $ console server -d localhost The last part "localhost" is the argument to the "server --delete" command.
Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: extends AbstractOption
显示文件 Open project: webmozart/console Class Usage Examples

Public Methods

Method Description
__construct ( string $longName, string | null $shortName = null, array $aliases = [], integer $flags, string $description = null ) Creates the command option.
getLongAliases ( ) : string[] Returns all long alias names.
getShortAliases ( ) : string[] Returns all short alias names.

Private Methods

Method Description
assertLongAliasValid ( $alias )
assertShortAliasValid ( $alias )
removeDashPrefix ( $string )

Method Details

__construct() public method

Creates the command option.
public __construct ( string $longName, string | null $shortName = null, array $aliases = [], integer $flags, string $description = null )
$longName string The long option name.
$shortName string | null The short option name.
$aliases array A list of alias names.
$flags integer A bitwise combination of the option flag constants.
$description string A human-readable description of the option.

getLongAliases() public method

Returns all long alias names.
public getLongAliases ( ) : string[]
return string[] The long alias names.

getShortAliases() public method

Returns all short alias names.
public getShortAliases ( ) : string[]
return string[] The short alias names.