Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
33 | 4 | public static function fromArray(array $data): self |
|
34 | { |
||
35 | 4 | if ($diff = \array_diff(['type', 'gender', 'value'], \array_keys($data))) { |
|
36 | 1 | throw new InvalidEntryInputDataException('Input entry keys missing', $diff); |
|
37 | } |
||
38 | |||
39 | 3 | return new static(new Type($data['type']), new Gender($data['gender']), $data['value']); |
|
40 | } |
||
57 |