| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 1 | public function getInsideStream(\SplFileInfo $file) |
|
| 38 | { |
||
| 39 | 1 | if (is_null($this->uriInsideArchive)) { |
|
| 40 | throw new \LogicException('This compressed archive has multiple files in it. Cannot create a single stream.'); |
||
| 41 | } |
||
| 42 | |||
| 43 | 1 | $streamUri = $this->wrapper.'://'.$file.'#'.$this->uriInsideArchive; |
|
| 44 | 1 | $uncompressedUri = tempnam('/tmp', 'compressed'); |
|
| 45 | 1 | file_put_contents($uncompressedUri, file_get_contents($streamUri)); |
|
| 46 | |||
| 47 | 1 | return new \SplFileInfo($uncompressedUri); |
|
| 48 | } |
||
| 49 | |||
| 55 |