1 | <?php |
||
10 | class PrivateStaticTransformer implements TransformerInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $classes = []; |
||
16 | |||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $sort = 0; |
||
21 | |||
22 | /** |
||
23 | * @var ConfigCollectionInterface |
||
24 | */ |
||
25 | protected $collection; |
||
26 | |||
27 | /** |
||
28 | * @param array $classes |
||
29 | */ |
||
30 | 3 | public function __construct(array $classes, ConfigCollectionInterface $collection) |
|
35 | |||
36 | /** |
||
37 | * This loops through each class and fetches the private static config for each class. |
||
38 | */ |
||
39 | 3 | public function transform() |
|
57 | |||
58 | /** |
||
59 | * This is responsible for introspecting a given class and returning an |
||
60 | * array continaing all of its private statics |
||
61 | * |
||
62 | * @param string $class |
||
63 | * |
||
64 | * @return ConfigItem |
||
65 | */ |
||
66 | 2 | protected function getClassConfig($class) |
|
94 | |||
95 | } |
||
96 |
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.