PHP Класс Webmozart\Console\Api\Config\OptionCommandConfig

С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Наследование: extends SubCommandConfig
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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 buildArgsFormat ( ArgsFormat $baseFormat = null )
$baseFormat Webmozart\Console\Api\Args\Format\ArgsFormat

getLongName() публичный Метод

Alias of {@link getName()}.
public getLongName ( ) : string
Результат string The command name.

getShortName() публичный Метод

Returns the short option name of the command.
public getShortName ( ) : string
Результат string The short option name.

isLongNamePreferred() публичный Метод

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
Результат boolean Returns `true` if the long name should be preferred over the short name.

isShortNamePreferred() публичный Метод

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
Результат boolean Returns `true` if the short name should be preferred over the long name.

setLongName() публичный Метод

Alias of {@link setName()}.
public setLongName ( string $name ) : static
$name string The command name.
Результат static The current instance.

setName() публичный Метод

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.
Результат static The current instance.

setPreferLongName() публичный Метод

This information is mainly used in the help where the preferred name is listed before alternative names.
public setPreferLongName ( ) : static
Результат static The current instance.

setPreferShortName() публичный Метод

This information is mainly used in the help where the preferred name is listed before alternative names.
public setPreferShortName ( ) : static
Результат static The current instance.

setShortName() публичный Метод

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.
Результат static The current instance.