| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function fetch(string $url) : string |
||
| 19 | { |
||
| 20 | $session = \curl_init($url); |
||
| 21 | |||
| 22 | \curl_setopt($session, CURLOPT_RETURNTRANSFER, 1); |
||
|
|
|||
| 23 | |||
| 24 | $result = \curl_exec($session); |
||
| 25 | |||
| 26 | \curl_close($session); |
||
| 27 | |||
| 28 | if (!\is_string($result)) { |
||
| 29 | $result = ""; |
||
| 30 | } |
||
| 31 | |||
| 32 | return $result; |
||
| 33 | } |
||
| 35 |