1 | <?php |
||
14 | class ArgumentParser |
||
15 | { |
||
16 | protected $sep_counter; |
||
17 | |||
18 | protected $arg_defaults = array( |
||
19 | 'task_name' => '', |
||
20 | 'timeout' => '', |
||
21 | 'automatic_garbage_collect' => TRUE, |
||
22 | 'command' => '', |
||
23 | ); |
||
24 | |||
25 | /** |
||
26 | * @param array $argv |
||
27 | * |
||
28 | * @return array |
||
|
|||
29 | * @throws \InvalidArgumentException |
||
30 | */ |
||
31 | public function parse(array $argv) |
||
44 | |||
45 | /** |
||
46 | * @param array $args |
||
47 | * |
||
48 | * @return int |
||
49 | * @throws \InvalidArgumentException |
||
50 | */ |
||
51 | protected function timeout($args) |
||
59 | |||
60 | /** |
||
61 | * @param array $args |
||
62 | * |
||
63 | * @return string |
||
64 | * @throws \InvalidArgumentException |
||
65 | */ |
||
66 | protected function task_name($args) |
||
74 | |||
75 | /** |
||
76 | * @param array $args |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | protected function automatic_garbage_collect($args) |
||
88 | |||
89 | /** |
||
90 | * @param $argv |
||
91 | * |
||
92 | * @return string |
||
93 | * @throws \InvalidArgumentException |
||
94 | */ |
||
95 | protected function command($argv) |
||
104 | |||
105 | /** |
||
106 | * @param array $argv |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | protected function find_sep_counter($argv) |
||
122 | |||
123 | /** |
||
124 | * @param array $argv |
||
125 | * |
||
126 | * @return array |
||
127 | */ |
||
128 | protected function find_arg_parts($argv) |
||
147 | |||
148 | /** |
||
149 | * @param array $argv |
||
150 | * |
||
151 | * @return array |
||
152 | */ |
||
153 | protected function key_value_strings($argv) |
||
162 | |||
163 | /** |
||
164 | * @param array $argv |
||
165 | * |
||
166 | * @return array |
||
167 | */ |
||
168 | protected function escaped_command_parts($argv) |
||
177 | |||
178 | } |
||
179 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.