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