1 | <?php |
||
9 | class StreamFactory implements StreamFactoryInterface |
||
10 | { |
||
11 | /** |
||
12 | * Create a new stream from a string. |
||
13 | * |
||
14 | * The stream SHOULD be created with a temporary resource. |
||
15 | * |
||
16 | * @param string $content |
||
17 | * |
||
18 | * @return StreamInterface |
||
19 | */ |
||
20 | 3 | public function createStream($content = '') |
|
27 | |||
28 | /** |
||
29 | * Create a stream from an existing file. |
||
30 | * |
||
31 | * The file MUST be opened using the given mode, which may be any mode |
||
32 | * supported by the `fopen` function. |
||
33 | * |
||
34 | * @param string $file |
||
35 | * @param string $mode |
||
36 | * |
||
37 | * @return StreamInterface |
||
38 | */ |
||
39 | 3 | public function createStreamFromFile($file, $mode = 'r') |
|
45 | |||
46 | /** |
||
47 | * Create a new stream from an existing resource. |
||
48 | * |
||
49 | * The stream MUST be readable and may be writable. |
||
50 | * |
||
51 | * @param resource $resource |
||
52 | * |
||
53 | * @return StreamInterface |
||
54 | */ |
||
55 | 3 | public function createStreamFromResource($resource) |
|
59 | } |
||
60 |