Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
16 | 2 | public function validate($value, string $name = '', array $options = []): bool |
|
17 | { |
||
18 | 2 | if (count(array_diff($options['keys'], array_keys($value))) > 0) { |
|
19 | 1 | throw new TransformationException( |
|
20 | 1 | sprintf( |
|
21 | 1 | 'invalid keys (expected: %s) (actual: %s)', |
|
22 | 1 | implode(',', $options['keys']), |
|
23 | 1 | implode(',', array_keys($value)) |
|
24 | ) |
||
25 | ); |
||
26 | } |
||
27 | |||
28 | 1 | return true; |
|
29 | } |
||
31 |