Conditions | 4 |
Paths | 6 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 0 |
1 | <?php |
||
35 | 34 | public function __construct(array $data) |
|
36 | { |
||
37 | 34 | if (isset($data['value'])) { |
|
38 | 6 | $data['name'] = $data['value']; |
|
39 | 6 | unset($data['value']); |
|
40 | } |
||
41 | |||
42 | 34 | foreach ($data as $key => $value) { |
|
43 | 7 | if (!property_exists(__CLASS__, $key)) { |
|
44 | throw new InvalidArgumentException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__)); |
||
45 | } |
||
46 | 7 | $this->{$key} = $value; |
|
47 | } |
||
51 |