Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function request(string $request): string |
||
42 | { |
||
43 | $stream = fopen(trim($this->url), 'r', false, $this->buildContext($request)); |
||
44 | |||
45 | if (!is_resource($stream)) { |
||
46 | throw new ConnectionFailureException('Unable to establish a connection'); |
||
47 | } |
||
48 | |||
49 | return @json_decode(stream_get_contents($stream), true); |
||
50 | } |
||
51 | |||
72 |