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
Afficher le fichier Open project: webmozart/console Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
assertLongAliasValid ( $alias )
assertShortAliasValid ( $alias )
removeDashPrefix ( $string )

Method Details

__construct() public méthode

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 méthode

Returns all long alias names.
public getLongAliases ( ) : string[]
Résultat string[] The long alias names.

getShortAliases() public méthode

Returns all short alias names.
public getShortAliases ( ) : string[]
Résultat string[] The short alias names.