| Conditions | 5 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 25 | 10 | public function __construct(array $data) |
|
| 26 | { |
||
| 27 | 10 | if (empty($data)) { |
|
| 28 | 1 | throw new \InvalidArgumentException('Empty schemas provided'); |
|
| 29 | } |
||
| 30 | |||
| 31 | 9 | foreach ($data as $format => $schemas) { |
|
| 32 | 9 | if (!\is_string($format)) { |
|
| 33 | 1 | throw new \InvalidArgumentException($format.' is not a string'); |
|
| 34 | } |
||
| 35 | |||
| 36 | 8 | if (!\is_array($schemas)) { |
|
| 37 | 1 | throw new \InvalidArgumentException($schemas.' is not an array'); |
|
| 38 | } |
||
| 39 | |||
| 40 | 7 | $this->loadFormatSchemas($format, $schemas); |
|
| 41 | } |
||
| 76 |