Conditions | 3 |
Paths | 4 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
23 | 12 | public static function create($appPath = '', array $server = [], array $globals = []) |
|
24 | { |
||
25 | 12 | $globals = (empty($globals)) ? $GLOBALS : $globals; |
|
26 | 12 | $server = (empty($server)) ? $_SERVER : $server; |
|
27 | |||
28 | 12 | $sparkPlug = new SparkPlug($globals, $server, $appPath); |
|
29 | |||
30 | 12 | return $sparkPlug->getCodeIgniter(); |
|
31 | } |
||
32 | } |
||
33 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: