Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
58 | 7 | protected function loadFormatSchemas(string $format, array $schemas): void |
|
59 | { |
||
60 | 7 | $format = strtolower($format); |
|
61 | 7 | $this->schemas[$format] = []; |
|
62 | |||
63 | 7 | foreach ($schemas as $responseCode => $schema) { |
|
64 | 7 | if (!\is_int($responseCode)) { |
|
65 | 1 | throw new \InvalidArgumentException($responseCode.' is not an integer'); |
|
66 | } |
||
67 | |||
68 | 6 | if (!\is_string($schema)) { |
|
69 | 1 | throw new \InvalidArgumentException($schema.' is not a string'); |
|
70 | } |
||
71 | |||
72 | 5 | $this->schemas[$format][$responseCode] = $schema; |
|
73 | } |
||
74 | 5 | } |
|
75 | } |
||
76 |