| Total Complexity | 9 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class StreamFactory implements StreamFactoryInterface |
||
| 10 | { |
||
| 11 | public function createStream(string $content = ''): StreamInterface |
||
| 12 | { |
||
| 13 | $stream = new Stream('php://temp', 'r+'); |
||
| 14 | if ($content !== '') { |
||
| 15 | $stream->write($content); |
||
| 16 | } |
||
| 17 | return $stream; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface |
||
| 32 | } |
||
| 33 | |||
| 34 | public function createStreamFromResource($resource): StreamInterface |
||
| 40 | } |
||
| 41 | } |
||
| 42 |