Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
16 | public function fetch($filename) |
||
17 | { |
||
18 | $url = "{$this->baseUrl}/{$filename}"; |
||
19 | $contents = @file_get_contents($url); |
||
20 | |||
21 | if (false === $contents) { |
||
22 | return serialize([ |
||
23 | 'result' => false, |
||
24 | 'errors' => [ |
||
25 | [ |
||
26 | 'no' => 0, |
||
27 | 'str' => "file_get_contents() call failed with url: ${url}", |
||
28 | ], |
||
29 | ], |
||
30 | ]); |
||
31 | } |
||
32 | |||
33 | return $contents; |
||
34 | } |
||
36 |