1 | <?php |
||
21 | abstract class AbstractCommand |
||
22 | { |
||
23 | const CONFIG_FILE = 'phpoole.yml'; |
||
24 | |||
25 | /** |
||
26 | * @var Console |
||
27 | */ |
||
28 | protected $console; |
||
29 | /** |
||
30 | * @var Route |
||
31 | */ |
||
32 | protected $route; |
||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $path; |
||
37 | /** |
||
38 | * @var PHPoole |
||
39 | */ |
||
40 | protected $phpoole; |
||
41 | /** |
||
42 | * @var Filesystem |
||
43 | */ |
||
44 | protected $fs; |
||
45 | |||
46 | /** |
||
47 | * Start command processing. |
||
48 | * |
||
49 | * @param Route $route |
||
50 | * @param Console $console |
||
51 | * |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public function __invoke(Route $route, Console $console) |
||
70 | |||
71 | /** |
||
72 | * Process the command. |
||
73 | */ |
||
74 | abstract public function processCommand(); |
||
75 | |||
76 | /** |
||
77 | * @return Console |
||
78 | */ |
||
79 | public function getConsole() |
||
83 | |||
84 | /** |
||
85 | * @return Route |
||
86 | */ |
||
87 | public function getRoute() |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | public function getPath() |
||
99 | |||
100 | /** |
||
101 | * @param array $options |
||
102 | * |
||
103 | * @return PHPoole |
||
104 | */ |
||
105 | public function getPHPoole(array $options = []) |
||
155 | |||
156 | /** |
||
157 | * @param $text |
||
158 | */ |
||
159 | public function wlAnnonce($text) |
||
163 | |||
164 | /** |
||
165 | * @param $text |
||
166 | */ |
||
167 | public function wlDone($text) |
||
171 | |||
172 | /** |
||
173 | * @param $text |
||
174 | */ |
||
175 | public function wlAlert($text) |
||
179 | |||
180 | /** |
||
181 | * @param $text |
||
182 | */ |
||
183 | public function wlError($text) |
||
187 | } |
||
188 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.