Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function createStream(string $content = ''): StreamInterface |
||
17 | { |
||
18 | $resource = fopen(Stream::TEMPORARY_STREAM, 'rb+'); |
||
19 | |||
20 | if ($resource === false) { |
||
21 | throw new RuntimeException('Unabled to open temporary resource'); |
||
22 | } |
||
23 | |||
24 | fwrite($resource, $content); |
||
25 | rewind($resource); |
||
26 | |||
27 | return new Stream($resource); |
||
28 | } |
||
29 | |||
57 |