Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
29 | 12 | public function __construct(string $jsonSchema = null) |
|
30 | { |
||
31 | 12 | if (is_null($jsonSchema)) { |
|
32 | 12 | $schemaFile = realpath(__DIR__ . $this->defaultJsonSchemaFile); |
|
33 | 12 | if (!file_exists($schemaFile)) { |
|
34 | 3 | throw new \LogicException("The default schema file cannot be found: ${schemaFile}"); |
|
35 | } |
||
36 | 12 | $jsonSchema = file_get_contents($schemaFile); |
|
37 | } |
||
38 | |||
39 | $this->jsonSchema = Yaml::parse($jsonSchema, Yaml::PARSE_OBJECT_FOR_MAP); |
||
40 | } |
||
59 |