1 | <?php |
||
15 | class Stream extends AbstractStream implements ZapheusStreamInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var \Psr\Http\Message\StreamInterface |
||
19 | */ |
||
20 | protected $stream; |
||
21 | |||
22 | /** |
||
23 | * Initializes the stream instance. |
||
24 | * |
||
25 | * @param \Psr\Http\Message\StreamInterface $stream |
||
26 | */ |
||
27 | 84 | public function __construct(StreamInterface $stream) |
|
31 | |||
32 | /** |
||
33 | * Returns the remaining contents in a string |
||
34 | * |
||
35 | * @return string |
||
36 | * |
||
37 | * @throws \RuntimeException |
||
38 | */ |
||
39 | 6 | public function contents() |
|
43 | |||
44 | /** |
||
45 | * Get stream metadata as an associative array or retrieve a specific key. |
||
46 | * |
||
47 | * @param string $key |
||
48 | * @return array|mixed|null |
||
49 | */ |
||
50 | 3 | public function metadata($key = null) |
|
54 | |||
55 | /** |
||
56 | * Get the size of the stream if known. |
||
57 | * |
||
58 | * @return integer|null |
||
59 | */ |
||
60 | 3 | public function size() |
|
64 | |||
65 | /** |
||
66 | * Returns whether or not the stream is readable. |
||
67 | * |
||
68 | * @return boolean |
||
69 | */ |
||
70 | 3 | public function readable() |
|
74 | |||
75 | /** |
||
76 | * Returns whether or not the stream is seekable. |
||
77 | * |
||
78 | * @return boolean |
||
79 | */ |
||
80 | 3 | public function seekable() |
|
84 | |||
85 | /** |
||
86 | * Returns whether or not the stream is writable. |
||
87 | * |
||
88 | * @return boolean |
||
89 | */ |
||
90 | 3 | public function writable() |
|
94 | } |
||
95 |