Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 4.125 |
Changes | 0 |
1 | <?php |
||
31 | function fopen(string $filename, string $mode, bool $useIncludePath = true, $context = null) |
||
32 | { |
||
33 | 9 | if (is_resource($context)) { |
|
34 | $result = \fopen($filename, $mode, $useIncludePath, $context); |
||
35 | } else { |
||
36 | $result = \fopen($filename, $mode, $useIncludePath); |
||
37 | } |
||
38 | |||
39 | if ($result === false) { |
||
40 | 9 | throw new RuntimeException(sprintf( |
|
41 | 'Failed to open resource `%s`', |
||
42 | $filename |
||
43 | )); |
||
44 | } |
||
45 | |||
46 | return $result; |
||
47 | } |
||
48 |