1 | <?php declare(strict_types=1); |
||
9 | class JsonStream implements StreamInterface, ParsedContentsInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private $json = []; |
||
15 | |||
16 | /** |
||
17 | * @var StreamInterface |
||
18 | */ |
||
19 | private $bufferStream; |
||
20 | |||
21 | 6 | public function __construct(array $json) |
|
28 | |||
29 | public function __toString() |
||
30 | { |
||
31 | return $this->getContents(); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return array |
||
36 | */ |
||
37 | 6 | public function getParsedContents(): array |
|
38 | { |
||
39 | 6 | return $this->json; |
|
40 | } |
||
41 | |||
42 | 1 | public function getContents() |
|
46 | |||
47 | public function close(): void |
||
50 | |||
51 | public function detach(): void |
||
54 | |||
55 | 1 | public function getSize() |
|
59 | |||
60 | public function isReadable() |
||
64 | |||
65 | public function isWritable() |
||
69 | |||
70 | public function isSeekable() |
||
74 | |||
75 | public function rewind() |
||
79 | |||
80 | public function seek($offset, $whence = \SEEK_SET) |
||
84 | |||
85 | public function eof() |
||
89 | |||
90 | public function tell() |
||
94 | |||
95 | /** |
||
96 | * Reads data from the buffer. |
||
97 | * @param mixed $length |
||
98 | */ |
||
99 | public function read($length) |
||
103 | |||
104 | /** |
||
105 | * Writes data to the buffer. |
||
106 | * @param mixed $string |
||
107 | */ |
||
108 | public function write($string) |
||
112 | |||
113 | public function getMetadata($key = null) |
||
117 | } |
||
118 |