| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 6 | public function load($path) |
|
| 36 | { |
||
| 37 | 6 | $uri = $this->prefix . $path; |
|
| 38 | 6 | set_error_handler(function () use ($uri) { |
|
| 39 | 2 | throw SchemaLoadingException::create($uri); |
|
| 40 | 6 | }); |
|
| 41 | 3 | $response = file_get_contents($uri); |
|
| 42 | 2 | restore_error_handler(); |
|
| 43 | |||
| 44 | 2 | if (!$response) { |
|
| 45 | 1 | throw SchemaLoadingException::create($uri); |
|
| 46 | } |
||
| 47 | |||
| 48 | 1 | return $this->jsonDecoder->decode($response); |
|
| 49 | } |
||
| 50 | } |
||
| 51 |