Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | final class StreamFactory implements StreamFactoryInterface |
||
14 | { |
||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | */ |
||
18 | 5 | public function createStream(string $content = ''): StreamInterface |
|
19 | { |
||
20 | 5 | $stream = new Stream(); |
|
21 | 5 | $stream->write($content); |
|
22 | 5 | $stream->rewind(); |
|
23 | 5 | return $stream; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | 4 | public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | * |
||
37 | * @psalm-suppress DocblockTypeContradiction |
||
38 | */ |
||
39 | 2 | public function createStreamFromResource($resource): StreamInterface |
|
48 |