PHP Class Yosymfony\Spress\Plugin\CommandDefinition

Author: Victor Puertas ([email protected])
Afficher le fichier Open project: spress/spress Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

addArgument() public méthode

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() public méthode

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() public méthode

Gets the arguments registered.
public getArguments ( ) : array
Résultat array Each element is an array with the following signature: name, mode, description, default

getDescription() public méthode

Returns the description for the command.
public getDescription ( ) : string
Résultat string The description for the command

getHelp() public méthode

Returns the help for the command.
public getHelp ( ) : string
Résultat string The help for the command

getName() public méthode

Gets the name of the command.
public getName ( ) : string
Résultat string

getOptions() public méthode

Gets the options registered.
public getOptions ( ) : array
Résultat array Each element is an array with the following signature: name, shortcut, mode, description, default

setDescription() public méthode

Sets the description for the command.
public setDescription ( string $description ) : Command
$description string The description for the command
Résultat Command The current instance

setHelp() public méthode

Sets the help for the command.
public setHelp ( string $help ) : Command
$help string The help for the command
Résultat Command The current instance