PHP 클래스 pharext\Cli\Args

상속: implements ArrayAccess
파일 보기 프로젝트 열기: m6w6/pharext 1 사용 예제들

공개 메소드들

메소드 설명
__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