PHP Class Webmozart\Console\Api\Config\OptionCommandConfig

Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: extends SubCommandConfig
Afficher le fichier Open project: webmozart/console Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $name = null, string $shortName = null, CommandConfig $parentConfig = null, ApplicationConfig $applicationConfig = null ) Creates a new configuration.
buildArgsFormat ( ArgsFormat $baseFormat = null )
getLongName ( ) : string Alias of {@link getName()}.
getShortName ( ) : string Returns the short option name of the command.
isLongNamePreferred ( ) : boolean Returns whether the long name should be preferred over the short name.
isShortNamePreferred ( ) : boolean Returns whether the short name should be preferred over the long name.
setLongName ( string $name ) : static Alias of {@link setName()}.
setName ( string $name ) : static Sets the name of the command.
setPreferLongName ( ) : static Marks the long name to be preferred over the short name.
setPreferShortName ( ) : static Marks the short name to be preferred over the long name.
setShortName ( string $shortName ) : static Sets the short option name of the command.

Method Details

__construct() public méthode

Creates a new configuration.
public __construct ( string $name = null, string $shortName = null, CommandConfig $parentConfig = null, ApplicationConfig $applicationConfig = null )
$name string The long option name of the command.
$shortName string The short option name of the command.
$parentConfig CommandConfig The parent configuration.
$applicationConfig ApplicationConfig The application configuration.

buildArgsFormat() public méthode

public buildArgsFormat ( ArgsFormat $baseFormat = null )
$baseFormat Webmozart\Console\Api\Args\Format\ArgsFormat

getLongName() public méthode

Alias of {@link getName()}.
public getLongName ( ) : string
Résultat string The command name.

getShortName() public méthode

Returns the short option name of the command.
public getShortName ( ) : string
Résultat string The short option name.

isLongNamePreferred() public méthode

If no preference was set, the short name is preferred by default if one is set. If no short name is set, the long name is preferred by default.
public isLongNamePreferred ( ) : boolean
Résultat boolean Returns `true` if the long name should be preferred over the short name.

isShortNamePreferred() public méthode

If no preference was set, the short name is preferred by default if one is set. If no short name is set, the long name is preferred by default.
public isShortNamePreferred ( ) : boolean
Résultat boolean Returns `true` if the short name should be preferred over the long name.

setLongName() public méthode

Alias of {@link setName()}.
public setLongName ( string $name ) : static
$name string The command name.
Résultat static The current instance.

setName() public méthode

Contrary to the base implementation, the name of an option command must contain at least two characters.
public setName ( string $name ) : static
$name string The name of the command.
Résultat static The current instance.

setPreferLongName() public méthode

This information is mainly used in the help where the preferred name is listed before alternative names.
public setPreferLongName ( ) : static
Résultat static The current instance.

setPreferShortName() public méthode

This information is mainly used in the help where the preferred name is listed before alternative names.
public setPreferShortName ( ) : static
Résultat static The current instance.

setShortName() public méthode

The short name must consist of a single letter. The short name is preceded by a single dash "-" when calling the command: $ server -d localhost In the example above, "d" is the short name of the "server --delete" command.
public setShortName ( string $shortName ) : static
$shortName string The short option name.
Résultat static The current instance.