Conditions | 8 |
Paths | 24 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | protected function hydrate(array $data) |
||
28 | { |
||
29 | foreach ($def as $key => $creator) { |
||
|
|||
30 | if (isset($data[$key])) { |
||
31 | if ($creator && is_array($data[$key])) { |
||
32 | $this->{$key} = call_user_func($creator, $data[$key]); |
||
33 | } else { |
||
34 | $this->{$key} = $data[$key]; |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 | if (isset($data['id'])) { |
||
39 | $this->id = $data['id']; |
||
40 | } |
||
41 | if (isset($data['target'])) { |
||
42 | $this->target = is_array($data['target']) ? AbstractTarget::create($data['target']) : $data['target']; |
||
43 | } |
||
44 | |||
45 | return $this; |
||
46 | } |
||
47 | } |
||
48 |
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.