OptionContainer
in package
Abstract base class.
Class attributes: standardOptionList : [Option] list of standard options that will be accepted by all instances of this parser class (intended to be overridden by subclasses).
Instance attributes: optionList : [Option] the list of Option objects contained by this OptionContainer shortOpt : { string : Option } dictionary mapping short option strings, eg. "-f" or "-X", to the Option instances that implement them. If an Option has multiple short option strings, it will appears in this dictionary multiple times. [1] longOpt : { string : Option } dictionary mapping long option strings, eg. "--file" or "--exclude", to the Option instances that implement them. Again, a given Option can occur multiple times in this dictionary. [1] defaults : { string : any } dictionary mapping option destination names to default values for each destination [1]
[1] These mappings are common to (shared by) all components of the controlling Horde_Argv_Parser, where they are initially created.
Tags
Table of Contents
- $conflictHandler : mixed
- $defaults : mixed
- $description : mixed
- $longOpt : mixed
- $optionClass : mixed
- $optionList : mixed
- $shortOpt : mixed
- __construct() : mixed
- Initialize the option list and related data structures.
- addOption() : mixed
- addOptions() : mixed
- formatDescription() : mixed
- formatHelp() : mixed
- formatOptionHelp() : mixed
- getDescription() : mixed
- getOption() : mixed
- hasOption() : mixed
- removeOption() : mixed
- setConflictHandler() : mixed
- setDescription() : mixed
- _checkConflict() : mixed
- _createOptionMappings() : mixed
- For use by Horde_Argv_Parser constructor -- create the master option mappings used by this Horde_Argv_Parser and all OptionGroups that it owns.
- _shareOptionMappings() : mixed
- For use by OptionGroup constructor -- use shared option mappings from the Horde_Argv_Parser that owns this OptionGroup.
Properties
$conflictHandler
public
mixed
$conflictHandler
$defaults
public
mixed
$defaults
= array()
$description
public
mixed
$description
= ''
$longOpt
public
mixed
$longOpt
= array()
$optionClass
public
mixed
$optionClass
= \Horde\Argv\Option::class
$optionList
public
mixed
$optionList
= array()
$shortOpt
public
mixed
$shortOpt
= array()
Methods
__construct()
Initialize the option list and related data structures.
public
__construct(mixed $optionClass, mixed $conflictHandler, mixed $description) : mixed
This method must be provided by subclasses, and it must initialize at least the following instance attributes: optionList, shortOpt, longOpt, defaults.
Parameters
- $optionClass : mixed
- $conflictHandler : mixed
- $description : mixed
Return values
mixed —addOption()
public
addOption() : mixed
Return values
mixed —addOptions()
public
addOptions(mixed $optionList) : mixed
Parameters
- $optionList : mixed
Return values
mixed —formatDescription()
public
formatDescription([mixed $formatter = null ]) : mixed
Parameters
- $formatter : mixed = null
Return values
mixed —formatHelp()
public
formatHelp([mixed $formatter = null ]) : mixed
Parameters
- $formatter : mixed = null
Return values
mixed —formatOptionHelp()
public
formatOptionHelp([mixed $formatter = null ]) : mixed
Parameters
- $formatter : mixed = null
Return values
mixed —getDescription()
public
getDescription() : mixed
Return values
mixed —getOption()
public
getOption(mixed $opt_str) : mixed
Parameters
- $opt_str : mixed
Return values
mixed —hasOption()
public
hasOption(mixed $opt_str) : mixed
Parameters
- $opt_str : mixed
Return values
mixed —removeOption()
public
removeOption(mixed $opt_str) : mixed
Parameters
- $opt_str : mixed
Return values
mixed —setConflictHandler()
public
setConflictHandler(mixed $handler) : mixed
Parameters
- $handler : mixed
Return values
mixed —setDescription()
public
setDescription(mixed $description) : mixed
Parameters
- $description : mixed
Return values
mixed —_checkConflict()
protected
_checkConflict(mixed $option) : mixed
Parameters
- $option : mixed
Return values
mixed —_createOptionMappings()
For use by Horde_Argv_Parser constructor -- create the master option mappings used by this Horde_Argv_Parser and all OptionGroups that it owns.
protected
_createOptionMappings() : mixed
Return values
mixed —_shareOptionMappings()
For use by OptionGroup constructor -- use shared option mappings from the Horde_Argv_Parser that owns this OptionGroup.
protected
_shareOptionMappings(mixed $parser) : mixed
Parameters
- $parser : mixed