1 | <?php |
||
11 | class Parser |
||
12 | { |
||
13 | /** |
||
14 | * @var \Redbox\Cli\Arguments\Filter |
||
15 | */ |
||
16 | protected $filter; |
||
17 | |||
18 | /** |
||
19 | * @var \Redbox\Cli\Arguments\Manager |
||
20 | */ |
||
21 | protected $manager; |
||
22 | |||
23 | /** |
||
24 | * Parser constructor. |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $arguments; |
||
28 | |||
29 | /** |
||
30 | * Parser constructor. |
||
31 | * |
||
32 | * @param Manager $manager |
||
33 | */ |
||
34 | 13 | public function __construct(Manager $manager = NULL) |
|
38 | |||
39 | /** |
||
40 | * Set the filter for the parser. |
||
41 | * |
||
42 | * @param Filter $filter |
||
43 | * @param array $arguments |
||
44 | */ |
||
45 | 9 | public function setFilter(Filter $filter, array $arguments = []) |
|
51 | |||
52 | /** |
||
53 | * Return the script name. |
||
54 | * |
||
55 | * @return mixed |
||
56 | */ |
||
57 | 2 | public function getCommand() |
|
62 | |||
63 | |||
64 | /** |
||
65 | * This is it, we parse the given arguments. |
||
66 | * |
||
67 | * @throws \Exception |
||
68 | */ |
||
69 | 9 | public function parse() |
|
101 | |||
102 | /** |
||
103 | * Build the option arrays that could be used with getopt() |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | 9 | private function buildOptions() |
|
129 | } |