Conditions | 3 |
Paths | 3 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | 191 | public function __construct(array $data = []) |
|
10 | { |
||
11 | 191 | foreach ($data as $key => $value) { |
|
12 | 188 | if (!\property_exists($this, $key)) { |
|
13 | 1 | throw new \InvalidArgumentException(\sprintf('The class "%s" does not have the property "%s"', static::class, $key)); |
|
14 | } |
||
15 | 188 | $this->{$key} = $value; |
|
16 | } |
||
26 |