Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | 12 | public function __construct(string $path) |
|
12 | { |
||
13 | 12 | if (!file_exists($path)) { |
|
14 | 3 | throw new InvalidArgumentException("invalid path: `$path`"); |
|
15 | } |
||
16 | 12 | $content = file_get_contents($path); |
|
17 | 12 | assert(is_string($content)); |
|
18 | 12 | parent::__construct(json_decode($content, true)); |
|
19 | 12 | } |
|
21 |