| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 0 | ||
| 1 | <?php |
||
| 73 | 2 | public function exchangeArray($data) |
|
| 74 | { |
||
| 75 | 2 | foreach ($data as $prop => $value) { |
|
| 76 | 2 | if (property_exists($this, $prop)) { |
|
| 77 | 2 | $this->$prop = $value; |
|
| 78 | |||
| 79 | 2 | if (!in_array($prop, $this->changedFields)) { |
|
| 80 | 2 | $this->changedFields[] = $prop; |
|
| 81 | } |
||
| 82 | } else { |
||
| 83 | throw new \LogicException( |
||
| 84 | 2 | "The property '$prop' does not exists in the class ' " . get_class($this) . " '" |
|
| 85 | ); |
||
| 104 |