PHP Класс Yosymfony\Spress\Plugin\CommandDefinition

Автор: Victor Puertas ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( string $name ) Constructor.
addArgument ( string $name, integer $mode = null, string $description = '', mixed $default = null ) Adds a new command argument.
addOption ( string $name, string | array $shortcut = null, integer $mode = null, string $description = '', mixed $default = null ) Adds a new command option.
getArguments ( ) : array Gets the arguments registered.
getDescription ( ) : string Returns the description for the command.
getHelp ( ) : string Returns the help for the command.
getName ( ) : string Gets the name of the command.
getOptions ( ) : array Gets the options registered.
setDescription ( string $description ) : Command Sets the description for the command.
setHelp ( string $help ) : Command Sets the help for the command.

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

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

Constructor.
public __construct ( string $name )
$name string The name of the command. e.g: "update" or with namespace "theme:update"

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

Adds a new command argument.
public addArgument ( string $name, integer $mode = null, string $description = '', mixed $default = null )
$name string The argument name
$mode integer The argument mode: self::REQUIRED or self::OPTIONAL
$description string A description text
$default mixed The default value (for self::OPTIONAL mode only)

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

Adds a new command option.
public addOption ( string $name, string | array $shortcut = null, integer $mode = null, string $description = '', mixed $default = null )
$name string The option name
$shortcut string | array The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
$mode integer The option mode: One of the VALUE_* constants
$description string A description text
$default mixed The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)

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

Gets the arguments registered.
public getArguments ( ) : array
Результат array Each element is an array with the following signature: name, mode, description, default

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

Returns the description for the command.
public getDescription ( ) : string
Результат string The description for the command

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

Returns the help for the command.
public getHelp ( ) : string
Результат string The help for the command

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

Gets the name of the command.
public getName ( ) : string
Результат string

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

Gets the options registered.
public getOptions ( ) : array
Результат array Each element is an array with the following signature: name, shortcut, mode, description, default

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

Sets the description for the command.
public setDescription ( string $description ) : Command
$description string The description for the command
Результат Command The current instance

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

Sets the help for the command.
public setHelp ( string $help ) : Command
$help string The help for the command
Результат Command The current instance