Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
49 | protected function loadFormatSchemas(string $format, array $schemas): void |
||
50 | { |
||
51 | $format = strtolower($format); |
||
52 | $this->schemas[$format] = []; |
||
53 | |||
54 | foreach ($schemas as $responseCode => $schema) { |
||
55 | if (!is_int($responseCode)) { |
||
56 | throw new \InvalidArgumentException($responseCode.' is not an integer'); |
||
57 | } |
||
58 | |||
59 | if (!is_string($schema)) { |
||
60 | throw new \InvalidArgumentException($schema.' is not a string'); |
||
61 | } |
||
62 | |||
63 | $this->schemas[$format][$responseCode] = $schema; |
||
64 | } |
||
65 | } |
||
66 | } |
||
67 |