Conditions | 2 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2.5 |
Changes | 0 |
1 | <?php |
||
28 | 4 | protected function getComicFromUrl($url) |
|
29 | { |
||
30 | try { |
||
31 | 4 | $newestJson = file_get_contents($url); |
|
32 | 4 | return json_decode($newestJson); |
|
33 | } catch (Exception $ex) { |
||
34 | $this->getLoggingService()->log("failed to fetch comic from xkcd: " . $ex); |
||
35 | throw new ServerException(ServerError::CONNECTION_FAILED); |
||
36 | } |
||
61 | } |