| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function fromArray(array $data = []) |
||
| 16 | { |
||
| 17 | $object = new static(); |
||
| 18 | foreach (\get_object_vars($object) as $property => $default) { |
||
| 19 | if (!\array_key_exists($property, $data)) { |
||
| 20 | continue; |
||
| 21 | } |
||
| 22 | |||
| 23 | $object->{$property} = $data[$property]; |
||
| 24 | } |
||
| 25 | return $object; |
||
| 26 | } |
||
| 28 |