Conditions | 5 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 5.1158 |
Changes | 0 |
1 | <?php |
||
25 | protected function createInstance(array $connect) |
||
26 | { |
||
27 | 1 | // Exception on fail connection |
|
28 | 1 | $instance = new \PDO( |
|
29 | 1 | isset($connect['dsn']) ? $connect['dsn'] : null, |
|
30 | 1 | isset($connect['user']) ? $connect['user'] : null, |
|
31 | isset($connect['password']) ? $connect['password'] : null, |
||
32 | isset($connect['options']) ? $connect['options'] : null |
||
33 | 1 | ); |
|
34 | |||
35 | return $instance; |
||
36 | } |
||
37 | 1 | ||
65 |
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.