1 | <?php |
||
13 | class Coordinator |
||
14 | { |
||
15 | use Queueing; |
||
16 | |||
17 | /** @var Process */ |
||
18 | private $master; |
||
19 | |||
20 | /** @var \Ackintosh\Snidel\Pcntl */ |
||
21 | private $pcntl; |
||
22 | |||
23 | /** @var \Ackintosh\Snidel\Error */ |
||
24 | private $error; |
||
25 | |||
26 | /** @var \Ackintosh\Snidel\Log */ |
||
27 | private $log; |
||
28 | |||
29 | /** @var array */ |
||
30 | private $signals = [ |
||
31 | SIGTERM, |
||
32 | SIGINT, |
||
33 | ]; |
||
34 | |||
35 | /** @var \Ackintosh\Snidel\Config */ |
||
36 | private $config; |
||
37 | |||
38 | /** @var int */ |
||
39 | private $receivedSignal; |
||
40 | |||
41 | /** @var int */ |
||
42 | private $queuedCount = 0; |
||
43 | /** @var int */ |
||
44 | private $dequeuedCount = 0; |
||
45 | |||
46 | /** @var \Bernard\QueueFactory\PersistentFactory */ |
||
47 | private $factory; |
||
48 | |||
49 | /** @var \Bernard\Producer */ |
||
50 | private $producer; |
||
51 | |||
52 | /** @var \Bernard\Consumer */ |
||
53 | private $consumer; |
||
54 | |||
55 | /** @var \Bernard\Queue */ |
||
56 | private $resultQueue; |
||
57 | |||
58 | /** |
||
59 | * @param int $ownerPid |
||
|
|||
60 | */ |
||
61 | public function __construct(Config $config, $log) |
||
74 | |||
75 | /** |
||
76 | * @param \Ackintosh\Snidel\Task |
||
77 | * @return void |
||
78 | * @throws \RuntimeException |
||
79 | */ |
||
80 | public function enqueue($task) |
||
90 | |||
91 | /** |
||
92 | * @return int |
||
93 | */ |
||
94 | public function queuedCount() |
||
98 | |||
99 | /** |
||
100 | * @return int |
||
101 | */ |
||
102 | public function dequeuedCount() |
||
106 | |||
107 | /** |
||
108 | * fork master process |
||
109 | * |
||
110 | * @return Process $master |
||
111 | * @throws \RuntimeException |
||
112 | */ |
||
113 | public function forkMaster() |
||
172 | |||
173 | /** |
||
174 | * fork worker process |
||
175 | * |
||
176 | * @return \Ackintosh\Snidel\Worker |
||
177 | * @throws \RuntimeException |
||
178 | */ |
||
179 | private function forkWorker() |
||
228 | |||
229 | /** |
||
230 | * @return bool |
||
231 | */ |
||
232 | public function existsMaster() |
||
236 | |||
237 | /** |
||
238 | * send signal to master process |
||
239 | * |
||
240 | * @return void |
||
241 | */ |
||
242 | public function sendSignalToMaster($sig = SIGTERM) |
||
254 | |||
255 | /** |
||
256 | * @return void |
||
257 | */ |
||
258 | public function wait() |
||
262 | |||
263 | /** |
||
264 | * @return \Generator |
||
265 | */ |
||
266 | public function results() |
||
284 | |||
285 | /** |
||
286 | * @return bool |
||
287 | */ |
||
288 | public function hasError() |
||
292 | |||
293 | /** |
||
294 | * @return \Ackintosh\Snidel\Error |
||
295 | */ |
||
296 | public function getError() |
||
300 | |||
301 | public function __destruct() |
||
305 | } |
||
306 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.