Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function createStream(string $content = ''): StreamInterface |
||
24 | { |
||
25 | $resource = fopen('php://temp', 'rb+'); |
||
26 | |||
27 | if (! \is_resource($resource)) { |
||
28 | throw new RuntimeException('Cannot create stream'); |
||
29 | } |
||
30 | |||
31 | fwrite($resource, $content); |
||
32 | rewind($resource); |
||
33 | return $this->createStreamFromResource($resource); |
||
34 | } |
||
35 | |||
58 |