1 | <?php |
||
13 | class QueueProcessor |
||
14 | { |
||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | private $limit; |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | private $debug; |
||
24 | |||
25 | /** |
||
26 | * @var Process[] |
||
27 | */ |
||
28 | private $processes = []; |
||
29 | |||
30 | /** |
||
31 | * @var OutputInterface |
||
32 | */ |
||
33 | protected $output; |
||
34 | |||
35 | /** |
||
36 | * @var ManagerRegistry |
||
37 | */ |
||
38 | protected $doctrine; |
||
39 | |||
40 | /** |
||
41 | * @param ManagerRegistry $doctrine |
||
42 | */ |
||
43 | public function setDoctrine($doctrine) |
||
47 | |||
48 | /** |
||
49 | * @param OutputInterface $output |
||
50 | */ |
||
51 | public function setOutput(OutputInterface $output) |
||
55 | |||
56 | /** |
||
57 | * @param boolean $debug |
||
58 | */ |
||
59 | public function setDebug($debug) |
||
63 | |||
64 | /** |
||
65 | * @param int $limit |
||
66 | */ |
||
67 | public function setLimit($limit) |
||
71 | |||
72 | /** |
||
73 | * @throws \Exception |
||
74 | */ |
||
75 | public function process() |
||
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | private function getProcessParams() |
||
104 | |||
105 | /** |
||
106 | * |
||
107 | */ |
||
108 | private function wait() |
||
121 | |||
122 | /** |
||
123 | * @param QueuedTaskInterface $queuedTask |
||
124 | */ |
||
125 | private function start(QueuedTaskInterface $queuedTask) |
||
136 | |||
137 | /** |
||
138 | * @param string $command |
||
139 | * @return Process |
||
140 | */ |
||
141 | private function createProcess($command) |
||
152 | |||
153 | /** |
||
154 | * @param QueuedTaskInterface $queuedTask |
||
155 | * @return string |
||
156 | */ |
||
157 | private function createCommand(QueuedTaskInterface $queuedTask) |
||
169 | } |
||
170 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.