Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
30 | protected function process($uri, $context) |
||
31 | { |
||
32 | $http_response_header = []; |
||
33 | $resource = @fopen($uri, 'rb', false, $context); |
||
34 | |||
35 | if (is_resource($resource)) { |
||
36 | $copy = @fopen('php://memory', 'rb+'); |
||
37 | stream_copy_to_stream($resource, $copy); |
||
38 | fclose($resource); |
||
39 | } else { |
||
40 | $copy = $resource; |
||
41 | } |
||
42 | |||
43 | return [$copy, $http_response_header]; |
||
44 | } |
||
45 | } |
||
46 |