Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
27 | class StreamFactory implements StreamFactoryInterface |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | 5 | public function createStream(string $content = ''): StreamInterface |
|
34 | { |
||
35 | 5 | $stream = new PhpTempStream(); |
|
36 | 5 | if ($content === '') { |
|
37 | 1 | return $stream; |
|
38 | } |
||
39 | |||
40 | 4 | $stream->write($content); |
|
41 | 4 | $stream->rewind(); |
|
42 | |||
43 | 4 | return $stream; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 3 | public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 2 | public function createStreamFromResource($resource): StreamInterface |
|
62 |