Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.7085 |
Changes | 0 |
1 | <?php |
||
25 | function fopen(string $filename, string $mode, bool $useIncludePath = true, $context = null) |
||
26 | { |
||
27 | 9 | if (is_resource($context)) { |
|
28 | $result = \fopen($filename, $mode, $useIncludePath, $context); |
||
29 | } else { |
||
30 | 9 | $result = \fopen($filename, $mode, $useIncludePath); |
|
31 | } |
||
32 | |||
33 | 9 | if ($result === false) { |
|
34 | throw new RuntimeException(sprintf( |
||
35 | 'Failed to open file `%s` with fopen()', |
||
36 | $filename |
||
37 | )); |
||
38 | } |
||
39 | |||
40 | 9 | return $result; |
|
41 | } |
||
42 |