1 | <?php |
||
8 | class Parser |
||
9 | { |
||
10 | /** @var Collection */ |
||
11 | private $flags; |
||
12 | |||
13 | /** @var Collection */ |
||
14 | private $lists; |
||
15 | |||
16 | /** @var Collection */ |
||
17 | private $values; |
||
18 | |||
19 | public function __construct() |
||
23 | |||
24 | /** |
||
25 | * @param array $arguments |
||
26 | */ |
||
27 | public function parse(array $arguments) |
||
35 | |||
36 | /** |
||
37 | * @return Collection |
||
38 | */ |
||
39 | public function getFlags() |
||
43 | |||
44 | /** |
||
45 | * @return Collection |
||
46 | */ |
||
47 | public function getLists() |
||
51 | |||
52 | /** |
||
53 | * @return Collection |
||
54 | */ |
||
55 | public function getValues() |
||
59 | |||
60 | /** |
||
61 | * @param string $name |
||
62 | * @param mixed $value |
||
63 | */ |
||
64 | private function addToList($name, $value) |
||
79 | |||
80 | /** |
||
81 | * @param string $string |
||
82 | * @param string $search |
||
83 | * @return bool |
||
84 | */ |
||
85 | private function contains($string, $search) |
||
95 | |||
96 | private function handleLongNameListOrFlag($argument) |
||
107 | |||
108 | private function handleShortNameListOrFlag($argument) |
||
128 | |||
129 | private function initiate() |
||
135 | |||
136 | /** |
||
137 | * @param $argument |
||
138 | */ |
||
139 | private function addToFittingCollection($argument) |
||
151 | |||
152 | /** |
||
153 | * @param string $string |
||
154 | * @param string $start |
||
155 | * @return bool |
||
156 | */ |
||
157 | private function startsWith($string, $start) |
||
161 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.