| Conditions | 3 |
| Paths | 3 |
| Total Lines | 8 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 36 | private function openStreamIfNeeded() { |
|
| 32 | 36 | if ( $this->stream !== null ) { |
|
| 33 | 2 | return; |
|
| 34 | } |
||
| 35 | 36 | $this->createPathIfNeeded(); |
|
| 36 | 35 | $this->stream = @fopen( $this->url, 'a' ); |
|
| 37 | 35 | if ( $this->stream === false ) { |
|
| 38 | throw new LoggingError( 'Could not open ' . $this->url ); |
||
| 39 | } |
||
| 58 | } |
If you suppress an error, we recommend checking for the error condition explicitly: