Conditions | 7 |
Paths | 13 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function fromArray($data) |
||
27 | { |
||
28 | foreach ($data as $key => $val) { |
||
29 | if (is_int($key)) { |
||
30 | if (method_exists($this, "add")) { |
||
31 | $this->add($val); |
||
|
|||
32 | } |
||
33 | } |
||
34 | |||
35 | if (property_exists($this, $key)) { |
||
36 | if (isset($this->mappingClasses[$key])) { |
||
37 | $this->{$key} = new $this->mappingClasses[$key]($val); |
||
38 | if (method_exists($this->{$key}, "getAll")) { |
||
39 | $this->{$key} = $this->{$key}->getAll(); |
||
40 | } |
||
41 | } else { |
||
42 | $this->{$key} = $val; |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 | return $this; |
||
47 | } |
||
48 | |||
108 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.