Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function createStreamFromFile(string $file, string $mode = 'rb'): StreamInterface |
||
40 | { |
||
41 | $resource = fopen($file, $mode); |
||
42 | |||
43 | if (! \is_resource($resource)) { |
||
44 | throw new RuntimeException('Cannot create stream'); |
||
45 | } |
||
46 | |||
47 | return $this->createStreamFromResource($resource); |
||
48 | } |
||
49 | |||
58 |