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