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