1 | <?php |
||
18 | class Worker |
||
19 | { |
||
20 | /** @var \Ackintosh\Snidel\Task\Task */ |
||
21 | private $latestTask; |
||
22 | |||
23 | /** @var \Ackintosh\Snidel\Fork\Process */ |
||
24 | private $process; |
||
25 | |||
26 | /** @var \Ackintosh\Snidel\Task\QueueInterface */ |
||
27 | private $taskQueue; |
||
28 | |||
29 | /** @var \Ackintosh\Snidel\Result\QueueInterface */ |
||
30 | private $resultQueue; |
||
31 | |||
32 | /** @var \Ackintosh\Snidel\Pcntl */ |
||
33 | private $pcntl; |
||
34 | |||
35 | /** @var bool */ |
||
36 | private $done = false; |
||
37 | |||
38 | private $factory; |
||
39 | private $consumer; |
||
40 | private $producer; |
||
41 | |||
42 | /** |
||
43 | * @param \Ackintosh\Snidel\Fork\Process $process |
||
44 | */ |
||
45 | public function __construct($process) |
||
57 | |||
58 | /** |
||
59 | * @param \Ackintosh\Snidel\Task\QueueInterface |
||
60 | * @return void |
||
61 | */ |
||
62 | public function setTaskQueue(TaskQueueInterface $queue) |
||
66 | |||
67 | /** |
||
68 | * @param \Ackintosh\Snidel\Result\QueueInterface |
||
69 | * @return void |
||
70 | */ |
||
71 | public function setResultQueue(ResultQueueInterface $queue) |
||
75 | |||
76 | /** |
||
77 | * @return int |
||
78 | */ |
||
79 | public function getPid() |
||
83 | |||
84 | /** |
||
85 | * @return void |
||
86 | * @throws \RuntimeException |
||
87 | */ |
||
88 | public function run() |
||
93 | |||
94 | public function task($message) |
||
109 | |||
110 | /** |
||
111 | * @return void |
||
112 | * @throws \RuntimeException |
||
113 | */ |
||
114 | public function error() |
||
134 | |||
135 | /** |
||
136 | * @param int $sig |
||
137 | * @return void |
||
138 | */ |
||
139 | public function terminate($sig) |
||
145 | |||
146 | /** |
||
147 | * @return bool |
||
148 | */ |
||
149 | public function hasTask() |
||
153 | |||
154 | /** |
||
155 | * @return bool |
||
156 | */ |
||
157 | public function done() |
||
161 | } |
||
162 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.