| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| 1 | <?php |
||
| 33 | 8 | public function load($path) |
|
| 34 | { |
||
| 35 | 8 | $uri = $this->prefix . $path; |
|
| 36 | 8 | $ch = curl_init($uri); |
|
| 37 | 8 | curl_setopt_array($ch, $this->curlOptions); |
|
| 38 | 8 | list($response, $statusCode) = $this->getResponseBodyAndStatusCode($ch); |
|
| 39 | 8 | curl_close($ch); |
|
| 40 | |||
| 41 | 8 | if ($statusCode === 404 || !$response) { |
|
| 42 | 4 | throw JsonGuard\Exceptions\SchemaLoadingException::create($uri); |
|
| 43 | } |
||
| 44 | |||
| 45 | 4 | return JsonGuard\json_decode($response); |
|
| 46 | } |
||
| 47 | |||
| 84 |