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