| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function send($uri, $options) |
||
| 15 | { |
||
| 16 | $context = stream_context_create($options); |
||
| 17 | |||
| 18 | $stream = @fopen($uri, 'r', false, $context); |
||
| 19 | |||
| 20 | if ($stream == false) { |
||
| 21 | return array(); |
||
| 22 | } |
||
| 23 | |||
| 24 | $data = stream_get_contents($stream); |
||
| 25 | |||
| 26 | $metadata = stream_get_meta_data($stream); |
||
| 27 | fclose($stream); |
||
| 28 | |||
| 29 | return array( |
||
| 30 | 'data' => $data, |
||
| 31 | 'metadata' => $metadata, |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |