Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
ExternalFile | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
download | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | /** @noinspection PhpUnhandledExceptionInspection */ |
3 | declare(strict_types=1); |
4 | |
5 | class ExternalFile { |
6 | static function download($url): string { |
7 | try { |
8 | $content = file_get_contents($url); |
9 | return $content ? $content : ""; |
10 | |
11 | } catch (Exception $e) { |
12 | return ""; |
13 | } |
14 | } |
15 | } |