| Conditions | 4 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function load(array $data): void |
||
| 32 | { |
||
| 33 | foreach ($data as $name => $value) { |
||
| 34 | $key = Str::camel($name, true); |
||
| 35 | |||
| 36 | $setterMethod = 'set' . ucfirst($key); |
||
| 37 | if (method_exists($this, $setterMethod)) { |
||
| 38 | $this->{$setterMethod}($value); |
||
| 39 | } elseif (property_exists($this, $key)) { |
||
| 40 | $this->{$key} = $value; |
||
| 41 | } |
||
| 54 |