PHP Class GetOptionKit\Argument

Mostrar archivo Open project: c9s/getoptionkit Class Usage Examples

Public Properties

Property Type Description
$arg

Public Methods

Method Description
__construct ( $arg )
__toString ( )
anyOfOptions ( OptionCollection $options ) Check if an option is one of the option in the collection.
containsOptionValue ( )
extractExtraFlagOptions ( )
getOptionName ( ) : string Parse option and return the name after dash. e.g., '--foo' returns 'foo' '-f' returns 'f'.
getOptionValue ( )
isEmpty ( )
isLongOption ( )
isOption ( ) Check current argument is an option by the preceding dash.
isShortOption ( )
splitAsOption ( )
withExtraFlagOptions ( ) Check combined short flags for "-abc" or "-vvv".

Method Details

__construct() public method

public __construct ( $arg )

__toString() public method

public __toString ( )

anyOfOptions() public method

Check if an option is one of the option in the collection.
public anyOfOptions ( OptionCollection $options )
$options OptionCollection

containsOptionValue() public method

public containsOptionValue ( )

extractExtraFlagOptions() public method

getOptionName() public method

Parse option and return the name after dash. e.g., '--foo' returns 'foo' '-f' returns 'f'.
public getOptionName ( ) : string
return string

getOptionValue() public method

public getOptionValue ( )

isEmpty() public method

public isEmpty ( )

isLongOption() public method

public isLongOption ( )

isOption() public method

note this method does not work for string with negative value. -a --foo
public isOption ( )

isShortOption() public method

public isShortOption ( )

splitAsOption() public method

public splitAsOption ( )

withExtraFlagOptions() public method

like: -abc

Property Details

$arg public_oe property

public $arg