PHP Класс pharext\Cli\Args

Наследование: implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( array | Traversable $spec = null ) Compile the original spec
__get ( $o )
__isset ( $o )
__set ( $o, $v )
__unset ( $o )
compile ( array | Traversable $spec ) : pharext\Cli\Args Compile the original spec
getCompiledSpec ( ) : array Get compiled spec
getSpec ( ) : array Get original spec
offsetExists ( $o )
offsetGet ( $o )
offsetSet ( $o, $v )
offsetUnset ( $o )
parse ( integer $argc, array $argv ) : Generator Parse command line arguments according to the compiled spec.
toArray ( )
validate ( ) : Generator Validate that all required options were given.

Приватные методы

Метод Описание
opt ( string $o ) : string Retreive the canonical name (--long-name) of an option
optAcceptsArg ( string $o ) : boolean Check wether an option accepts any argument
optDefaultArg ( string $o ) : mixed Retreive the default argument of an option
optFlags ( string $o ) : integer Retrieve option's flags
optHalts ( string $o ) : boolean Check whether an option is flagged for halting argument processing
optHelp ( string $o ) : string Retrieve the help message of an option
optIsMulti ( string $o ) : boolean Check whether an option can be used more than once
optLongName ( string $o ) : string Retreive the long name of an option
optRequiresArg ( string $o ) : boolean Check whether an option needs an argument
optShortName ( string $o ) : string Retreive the short name of an option

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

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

Compile the original spec
public __construct ( array | Traversable $spec = null )
$spec array | Traversable

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

public __get ( $o )

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

public __isset ( $o )

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

public __set ( $o, $v )

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

public __unset ( $o )

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

Compile the original spec
public compile ( array | Traversable $spec ) : pharext\Cli\Args
$spec array | Traversable
Результат pharext\Cli\Args self

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

Get compiled spec
public getCompiledSpec ( ) : array
Результат array

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

Get original spec
public getSpec ( ) : array
Результат array

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

public offsetExists ( $o )

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

public offsetGet ( $o )

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

public offsetSet ( $o, $v )

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

public offsetUnset ( $o )

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

The Generator yields any parsing errors. Parsing will stop when all arguments are processed or the first option flagged Cli\Args::HALT was encountered.
public parse ( integer $argc, array $argv ) : Generator
$argc integer
$argv array
Результат Generator

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

public toArray ( )

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

The Generator yields any validation errors.
public validate ( ) : Generator
Результат Generator