1 | <?php |
||
5 | class Options //implements \ArrayAccess, \Iterator |
||
6 | { |
||
7 | private $options = []; |
||
8 | |||
9 | /** |
||
10 | * A map of all the options the parser recognises. |
||
11 | * The map is actually an array which associates short or long options with |
||
12 | * their appropriate parameters. Options which have both long and short |
||
13 | * versions would be repeated. This structure is used to quickly find the |
||
14 | * paramters of an option whether in the short form or long form. This |
||
15 | * parameter is automatically populated by the library as options are added. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | private $map; |
||
20 | |||
21 | 28 | public function add($options) |
|
39 | |||
40 | 28 | private function fillOption($option) |
|
48 | |||
49 | 25 | public function getMap() |
|
53 | |||
54 | 4 | private function stringOptionToArray($option) |
|
64 | |||
65 | 8 | public function getArray() |
|
69 | |||
70 | 25 | public function getDefaults() |
|
80 | } |
||
81 | |||
82 |