| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | 20 | public function getContentsAsStream() |
|
| 48 | { |
||
| 49 | 20 | $stream = @fopen($this->resource->getUri(), 'r'); |
|
| 50 | |||
| 51 | 20 | if ($stream === false) { |
|
| 52 | 4 | throw new \RuntimeException('Unable to open ' . $this->resource->getUri() . ' for reading'); |
|
| 53 | } |
||
| 54 | |||
| 55 | 16 | $this->streams[] = $stream; |
|
| 56 | |||
| 57 | 16 | return $stream; |
|
| 58 | } |
||
| 59 | } |
||
| 60 |
If you suppress an error, we recommend checking for the error condition explicitly: