Conditions | 4 |
Paths | 8 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
24 | public static function create(array $config) |
||
25 | { |
||
26 | $class = isset($config['class']) ? $config['class'] : $name; |
||
|
|||
27 | unset($config['class']); |
||
28 | |||
29 | if (!class_exists($class)) { |
||
30 | $class = __NAMESPACE__ . '\\' . $class; |
||
31 | } |
||
32 | $modifier = new $class(); |
||
33 | foreach ($config as $key => $value) { |
||
34 | $modifier->$key = $value; |
||
35 | } |
||
36 | |||
37 | return $modifier; |
||
38 | } |
||
39 | } |
||
40 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.