Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.032 |
Changes | 0 |
1 | <?php |
||
34 | 4 | public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface |
|
35 | { |
||
36 | 4 | $resource = fopen($filename, $mode); |
|
37 | |||
38 | 4 | if (!is_resource($resource)) { |
|
39 | throw new \InvalidArgumentException('Error while creating PHP stream'); |
||
40 | } |
||
41 | |||
42 | 4 | return $this->createStreamFromResource($resource); |
|
43 | } |
||
54 |