1 | <?php |
||
19 | abstract class AbstractCommand |
||
20 | { |
||
21 | const CONFIG_FILE = 'phpoole.yml'; |
||
22 | |||
23 | /** |
||
24 | * @var Console |
||
25 | */ |
||
26 | protected $console; |
||
27 | |||
28 | /** |
||
29 | * @var Route |
||
30 | */ |
||
31 | protected $route; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $path; |
||
37 | |||
38 | /** |
||
39 | * @var PHPoole |
||
40 | */ |
||
41 | protected $phpoole; |
||
42 | |||
43 | /** |
||
44 | * Start command processing. |
||
45 | * |
||
46 | * @param Route $route |
||
47 | * @param Console $console |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public function __invoke(Route $route, Console $console) |
||
65 | |||
66 | /** |
||
67 | * Process the command. |
||
68 | */ |
||
69 | abstract public function processCommand(); |
||
70 | |||
71 | /** |
||
72 | * @return Console |
||
73 | */ |
||
74 | public function getConsole() |
||
78 | |||
79 | /** |
||
80 | * @return Route |
||
81 | */ |
||
82 | public function getRoute() |
||
86 | |||
87 | /** |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getPath() |
||
94 | |||
95 | /** |
||
96 | * @param array $options |
||
97 | * |
||
98 | * @return PHPoole |
||
99 | */ |
||
100 | public function getPHPoole(array $options=[]) |
||
147 | |||
148 | /** |
||
149 | * @param $text |
||
150 | */ |
||
151 | public function wlAnnonce($text) |
||
155 | |||
156 | /** |
||
157 | * @param $text |
||
158 | */ |
||
159 | public function wlDone($text) |
||
163 | |||
164 | /** |
||
165 | * @param $text |
||
166 | */ |
||
167 | public function wlAlert($text) |
||
171 | |||
172 | /** |
||
173 | * @param $text |
||
174 | */ |
||
175 | public function wlError($text) |
||
179 | } |
||
180 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.