1 | <?php |
||
17 | abstract class StreamAbstract implements StreamInterface{ |
||
18 | |||
19 | public const MODES_READ = [ |
||
20 | 'a+' => true, |
||
21 | 'c+' => true, |
||
22 | 'c+b' => true, |
||
23 | 'c+t' => true, |
||
24 | 'r' => true, |
||
25 | 'r+' => true, |
||
26 | 'rb' => true, |
||
27 | 'rt' => true, |
||
28 | 'r+b' => true, |
||
29 | 'r+t' => true, |
||
30 | 'w+' => true, |
||
31 | 'w+b' => true, |
||
32 | 'w+t' => true, |
||
33 | 'x+' => true, |
||
34 | 'x+b' => true, |
||
35 | 'x+t' => true, |
||
36 | ]; |
||
37 | |||
38 | public const MODES_WRITE = [ |
||
39 | 'a' => true, |
||
40 | 'a+' => true, |
||
41 | 'c+' => true, |
||
42 | 'c+b' => true, |
||
43 | 'c+t' => true, |
||
44 | 'r+' => true, |
||
45 | 'rw' => true, |
||
46 | 'r+b' => true, |
||
47 | 'r+t' => true, |
||
48 | 'w' => true, |
||
49 | 'w+' => true, |
||
50 | 'wb' => true, |
||
51 | 'w+b' => true, |
||
52 | 'w+t' => true, |
||
53 | 'x+' => true, |
||
54 | 'x+b' => true, |
||
55 | 'x+t' => true, |
||
56 | ]; |
||
57 | |||
58 | /** |
||
59 | * @var \Psr\Http\Message\StreamInterface|resource |
||
60 | */ |
||
61 | protected $stream; |
||
62 | |||
63 | /** |
||
64 | * Closes the stream when the destructed |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function __destruct(){ |
||
71 | |||
72 | /** |
||
73 | * @inheritdoc |
||
74 | */ |
||
75 | public function __toString(){ |
||
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | public function close(){ |
||
87 | |||
88 | /** |
||
89 | * @inheritdoc |
||
90 | */ |
||
91 | public function detach(){ |
||
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | public function getSize():?int{ |
||
101 | |||
102 | /** |
||
103 | * @inheritdoc |
||
104 | */ |
||
105 | public function tell():int{ |
||
108 | |||
109 | /** |
||
110 | * @inheritdoc |
||
111 | */ |
||
112 | public function eof():bool{ |
||
115 | |||
116 | /** |
||
117 | * @inheritdoc |
||
118 | */ |
||
119 | public function isSeekable():bool{ |
||
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | */ |
||
126 | public function seek($offset, $whence = SEEK_SET):void{ |
||
129 | |||
130 | /** |
||
131 | * @inheritdoc |
||
132 | */ |
||
133 | public function rewind():void{ |
||
136 | |||
137 | /** |
||
138 | * @inheritdoc |
||
139 | */ |
||
140 | public function isWritable():bool{ |
||
143 | |||
144 | /** |
||
145 | * @inheritdoc |
||
146 | */ |
||
147 | public function write($string):int{ |
||
150 | |||
151 | /** |
||
152 | * @inheritdoc |
||
153 | */ |
||
154 | public function isReadable():bool{ |
||
157 | |||
158 | /** |
||
159 | * @inheritdoc |
||
160 | */ |
||
161 | public function read($length):string{ |
||
164 | |||
165 | /** |
||
166 | * @inheritdoc |
||
167 | */ |
||
168 | public function getContents():string{ |
||
171 | |||
172 | /** |
||
173 | * @inheritdoc |
||
174 | */ |
||
175 | public function getMetadata($key = null){ |
||
178 | |||
179 | } |
||
180 |