These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Configuration file for DI container. |
||
4 | */ |
||
5 | return [ |
||
6 | |||
7 | // Services to add to the container. |
||
8 | 1 | "services" => [ |
|
9 | "content" => [ |
||
10 | "shared" => true, |
||
11 | "callback" => function () { |
||
12 | 1 | $content = new \Anax\Content\FileBasedContent(); |
|
13 | 1 | $content->setDI($this); |
|
14 | |||
15 | // Load the configuration files |
||
16 | 1 | $cfg = $this->get("configuration"); |
|
17 | 1 | $config = $cfg->load("content.php"); |
|
18 | 1 | $file = $config["file"] ?? null; |
|
0 ignored issues
–
show
|
|||
19 | |||
20 | 1 | return $content; |
|
21 | 1 | } |
|
22 | ], |
||
23 | ], |
||
24 | ]; |
||
25 |
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.