1 | <?php |
||
19 | class ExecutorController extends AbstractConsoleController |
||
20 | { |
||
21 | /** |
||
22 | * Провайдер для получения ManagerRegistry |
||
23 | * |
||
24 | * @var ManagerRegistryProviderInterface |
||
25 | */ |
||
26 | protected $managerRegistryProvider; |
||
27 | |||
28 | /** |
||
29 | * Менеджер для получения Executor'ов |
||
30 | * |
||
31 | * @var FixtureExecutorManagerInterface |
||
32 | */ |
||
33 | protected $fixtureExecutorManager; |
||
34 | |||
35 | /** |
||
36 | * Разрешенные методы |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $allowedMethod = [ |
||
41 | 'import', |
||
42 | 'purge' |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * ExecutorController constructor. |
||
47 | * |
||
48 | * @param ManagerRegistryProviderInterface $managerRegistryProvider |
||
49 | * @param FixtureExecutorManagerInterface $fixtureExecutorManager |
||
50 | */ |
||
51 | public function __construct(ManagerRegistryProviderInterface $managerRegistryProvider, FixtureExecutorManagerInterface $fixtureExecutorManager) |
||
56 | |||
57 | /** |
||
58 | * |
||
59 | * |
||
60 | */ |
||
61 | public function executeFixtureAction() |
||
65 | |||
66 | |||
67 | /** |
||
68 | * |
||
69 | * |
||
70 | * @throws \Nnx\DoctrineFixtureModule\Controller\Exception\RuntimeException |
||
71 | */ |
||
72 | public function runExecutorAction() |
||
111 | |||
112 | /** |
||
113 | * Возвращает провайдер для получения ManagerRegistry |
||
114 | * |
||
115 | * @return ManagerRegistryProviderInterface |
||
116 | */ |
||
117 | public function getManagerRegistryProvider() |
||
121 | |||
122 | /** |
||
123 | * Устанавливает провайдер для получения ManagerRegistry |
||
124 | * |
||
125 | * @param ManagerRegistryProviderInterface $managerRegistryProvider |
||
126 | * |
||
127 | * @return $this |
||
128 | */ |
||
129 | public function setManagerRegistryProvider(ManagerRegistryProviderInterface $managerRegistryProvider) |
||
135 | |||
136 | /** |
||
137 | * Возвращает менеджер для получения Executor'ов |
||
138 | * |
||
139 | * @return FixtureExecutorManagerInterface |
||
140 | */ |
||
141 | public function getFixtureExecutorManager() |
||
145 | |||
146 | /** |
||
147 | * Устанавливает менеджер для получения Executor'ов |
||
148 | * |
||
149 | * @param FixtureExecutorManagerInterface $fixtureExecutorManager |
||
150 | * |
||
151 | * @return $this |
||
152 | */ |
||
153 | public function setFixtureExecutorManager($fixtureExecutorManager) |
||
159 | } |
||
160 |
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.