Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
6 | 3 | public static function autoload($class) |
|
7 | { |
||
8 | 3 | $class = str_replace('\\', DIRECTORY_SEPARATOR, $class); |
|
9 | |||
10 | 3 | $filename = dirname(__DIR__) . DIRECTORY_SEPARATOR . $class . '.php'; |
|
11 | |||
12 | 3 | if (is_file($filename)) { |
|
13 | 3 | include $filename; |
|
14 | 3 | } else { |
|
|
|||
15 | //throw new \Exception("Object '$class' not found", 2); |
||
16 | } |
||
17 | 3 | } |
|
18 | |||
37 |
This check looks for the
else
branches ofif
statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
else
branches can be removed.could be turned into
This is much more concise to read.