Conditions | 4 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
31 | 6 | private static function validateCapabilities(object $decoded): void |
|
32 | { |
||
33 | 6 | if ($decoded->capabilities ?? false) { |
|
34 | 3 | if (!is_array($decoded->capabilities)) { |
|
35 | 1 | throw new JsonFormatException( |
|
36 | 'JSON property `capabilities` must be of type `array`, `' . |
||
37 | 1 | gettype($decoded->capabilities) . '` provided.' |
|
38 | ); |
||
39 | } |
||
40 | |||
41 | 2 | array_walk($decoded->capabilities, function($item) { |
|
42 | 2 | if (!is_string($item)) { |
|
43 | 1 | throw new JsonFormatException("JSON property `capabilities` must only contain strings."); |
|
44 | } |
||
49 |