Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
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 | } |
||
42 | 5 | } |
|
43 | |||
76 |