1 | <?php |
||
5 | class Buffer implements BufferInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $data; |
||
11 | |||
12 | /** |
||
13 | * @param string $data |
||
14 | */ |
||
15 | 39 | public function __construct($data = '') |
|
19 | |||
20 | /** |
||
21 | * |
||
22 | */ |
||
23 | 1 | public function __destruct() |
|
27 | |||
28 | /** |
||
29 | * @override |
||
30 | * @inheritDoc |
||
31 | */ |
||
32 | 25 | public function __toString() |
|
36 | |||
37 | /** |
||
38 | * @override |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | 3 | public function length() |
|
45 | |||
46 | /** |
||
47 | * @override |
||
48 | * @inheritDoc |
||
49 | */ |
||
50 | 1 | public function count() |
|
54 | |||
55 | /** |
||
56 | * @override |
||
57 | * @inheritDoc |
||
58 | */ |
||
59 | 3 | public function isEmpty() |
|
63 | |||
64 | /** |
||
65 | * @override |
||
66 | * @inheritDoc |
||
67 | */ |
||
68 | 2 | public function push($data) |
|
72 | |||
73 | /** |
||
74 | * @override |
||
75 | * @inheritDoc |
||
76 | */ |
||
77 | 1 | public function unshift($data) |
|
81 | |||
82 | /** |
||
83 | * @override |
||
84 | * @inheritDoc |
||
85 | */ |
||
86 | 2 | public function shift($length) |
|
107 | |||
108 | /** |
||
109 | * @override |
||
110 | * @inheritDoc |
||
111 | */ |
||
112 | 6 | public function peek($length = 0, $offset = 0) |
|
139 | |||
140 | /** |
||
141 | * @override |
||
142 | * @inheritDoc |
||
143 | */ |
||
144 | 2 | public function pop($length) |
|
158 | |||
159 | /** |
||
160 | * @override |
||
161 | * @inheritDoc |
||
162 | */ |
||
163 | 4 | public function remove($length, $offset = 0) |
|
190 | |||
191 | /** |
||
192 | * @override |
||
193 | * @inheritDoc |
||
194 | */ |
||
195 | 1 | public function drain() |
|
201 | |||
202 | /** |
||
203 | * @override |
||
204 | * @inheritDoc |
||
205 | */ |
||
206 | 1 | public function insert($string, $position) |
|
210 | |||
211 | /** |
||
212 | * @override |
||
213 | * @inheritDoc |
||
214 | */ |
||
215 | 1 | public function replace($search, $replace) |
|
221 | |||
222 | /** |
||
223 | * @override |
||
224 | * @inheritDoc |
||
225 | */ |
||
226 | 2 | public function search($string, $reverse = false) |
|
235 | |||
236 | /** |
||
237 | * @override |
||
238 | * @inheritDoc |
||
239 | */ |
||
240 | 7 | public function offsetExists($index) |
|
244 | |||
245 | /** |
||
246 | * @override |
||
247 | * @inheritDoc |
||
248 | */ |
||
249 | 5 | public function offsetGet($index) |
|
253 | |||
254 | /** |
||
255 | * @override |
||
256 | * @inheritDoc |
||
257 | */ |
||
258 | 3 | public function offsetSet($index, $data) |
|
262 | |||
263 | /** |
||
264 | * @override |
||
265 | * @inheritDoc |
||
266 | */ |
||
267 | 2 | public function offsetUnset($index) |
|
274 | |||
275 | /** |
||
276 | * @override |
||
277 | * @inheritDoc |
||
278 | */ |
||
279 | 9 | public function getIterator() |
|
283 | } |
||
284 |