1 | <?php |
||
12 | class Container |
||
13 | { |
||
14 | /** @var int */ |
||
15 | private $masterPid; |
||
16 | |||
17 | /** @var \Ackintosh\Snidel\Pcntl */ |
||
18 | private $pcntl; |
||
19 | |||
20 | /** @var \Ackintosh\Snidel\Error */ |
||
21 | private $error; |
||
22 | |||
23 | /** @var \Ackintosh\Snidel\Task\QueueInterface */ |
||
24 | private $taskQueue; |
||
25 | |||
26 | /** @var \Ackintosh\Snidel\Result\QueueInterface */ |
||
27 | private $resultQueue; |
||
28 | |||
29 | /** @var \Ackintosh\Snidel\Log */ |
||
30 | private $log; |
||
31 | |||
32 | /** @var array */ |
||
33 | private $signals = [ |
||
34 | SIGTERM, |
||
35 | SIGINT, |
||
36 | ]; |
||
37 | |||
38 | /** @var \Ackintosh\Snidel\Config */ |
||
39 | private $config; |
||
40 | |||
41 | /** @var \Ackintosh\Snidel\QueueFactory */ |
||
42 | private $queueFactory; |
||
43 | |||
44 | /** @var int */ |
||
45 | private $receivedSignal; |
||
46 | |||
47 | /** |
||
48 | * @param int $ownerPid |
||
|
|||
49 | */ |
||
50 | public function __construct(Config $config, $log) |
||
58 | |||
59 | /** |
||
60 | * @param \Ackintosh\Snidel\Task |
||
61 | * @return void |
||
62 | * @throws \RuntimeException |
||
63 | */ |
||
64 | public function enqueue($task) |
||
72 | |||
73 | /** |
||
74 | * @return int |
||
75 | */ |
||
76 | public function queuedCount() |
||
84 | |||
85 | /** |
||
86 | * @return \Ackintosh\Snidel\Result\Result |
||
87 | */ |
||
88 | private function dequeue() |
||
92 | |||
93 | /** |
||
94 | * @return int |
||
95 | */ |
||
96 | public function dequeuedCount() |
||
104 | |||
105 | /** |
||
106 | * fork process |
||
107 | * |
||
108 | * @return \Ackintosh\Snidel\Fork\Fork |
||
109 | * @throws \RuntimeException |
||
110 | */ |
||
111 | private function fork() |
||
122 | |||
123 | /** |
||
124 | * fork master process |
||
125 | * |
||
126 | * @return int $masterPid |
||
127 | */ |
||
128 | public function forkMaster() |
||
184 | |||
185 | /** |
||
186 | * fork worker process |
||
187 | * |
||
188 | * @return \Ackintosh\Snidel\Worker |
||
189 | * @throws \RuntimeException |
||
190 | */ |
||
191 | private function forkWorker() |
||
241 | |||
242 | /** |
||
243 | * @return bool |
||
244 | */ |
||
245 | public function existsMaster() |
||
249 | |||
250 | /** |
||
251 | * send signal to master process |
||
252 | * |
||
253 | * @return void |
||
254 | */ |
||
255 | public function sendSignalToMaster($sig = SIGTERM) |
||
267 | |||
268 | /** |
||
269 | * @return void |
||
270 | */ |
||
271 | public function wait() |
||
280 | |||
281 | /** |
||
282 | * @return \Generator |
||
283 | */ |
||
284 | public function results() |
||
297 | |||
298 | /** |
||
299 | * @return bool |
||
300 | */ |
||
301 | public function hasError() |
||
305 | |||
306 | /** |
||
307 | * @return \Ackintosh\Snidel\Error |
||
308 | */ |
||
309 | public function getError() |
||
313 | |||
314 | public function __destruct() |
||
319 | } |
||
320 |
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.