Conditions | 5 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
23 | public function __construct($data = null, bool $strict = false) |
||
24 | { |
||
25 | if (is_array($data) || is_object($data)) { |
||
26 | foreach ($data as $key => $value) { |
||
27 | $this->setField($key, $value, $strict); |
||
28 | } |
||
29 | } elseif ($data !== null) { |
||
30 | throw new InvalidArgumentException( |
||
31 | get_called_class() . |
||
32 | ' constructor expects array, object, or null' |
||
33 | ); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 |