@@ -644,6 +644,9 @@ discard block |
||
644 | 644 | return $num; |
645 | 645 | } |
646 | 646 | |
647 | + /** |
|
648 | + * @param integer $size |
|
649 | + */ |
|
647 | 650 | private function unpackArrayData($size) |
648 | 651 | { |
649 | 652 | $array = []; |
@@ -654,6 +657,9 @@ discard block |
||
654 | 657 | return $array; |
655 | 658 | } |
656 | 659 | |
660 | + /** |
|
661 | + * @param integer $size |
|
662 | + */ |
|
657 | 663 | private function unpackMapData($size) |
658 | 664 | { |
659 | 665 | $map = []; |
@@ -713,6 +719,9 @@ discard block |
||
713 | 719 | throw UnpackingFailedException::invalidMapKeyType($c); |
714 | 720 | } |
715 | 721 | |
722 | + /** |
|
723 | + * @param integer $length |
|
724 | + */ |
|
716 | 725 | private function unpackExtData($length) |
717 | 726 | { |
718 | 727 | if (!isset($this->buffer[$this->offset + $length])) { // 1 (type) + length - 1 |
@@ -143,6 +143,9 @@ discard block |
||
143 | 143 | return $bool ? "\xc3" : "\xc2"; |
144 | 144 | } |
145 | 145 | |
146 | + /** |
|
147 | + * @param integer $int |
|
148 | + */ |
|
146 | 149 | public function packInt($int) |
147 | 150 | { |
148 | 151 | if ($int >= 0) { |
@@ -178,6 +181,9 @@ discard block |
||
178 | 181 | return \pack('CJ', 0xd3, $int); |
179 | 182 | } |
180 | 183 | |
184 | + /** |
|
185 | + * @param double $float |
|
186 | + */ |
|
181 | 187 | public function packFloat($float) |
182 | 188 | { |
183 | 189 | return $this->isForceFloat32 |
@@ -195,6 +201,9 @@ discard block |
||
195 | 201 | return "\xcb".\pack('E', $float); |
196 | 202 | } |
197 | 203 | |
204 | + /** |
|
205 | + * @param string $str |
|
206 | + */ |
|
198 | 207 | public function packStr($str) |
199 | 208 | { |
200 | 209 | $length = \strlen($str); |
@@ -212,6 +221,9 @@ discard block |
||
212 | 221 | return \pack('CN', 0xdb, $length).$str; |
213 | 222 | } |
214 | 223 | |
224 | + /** |
|
225 | + * @param string $str |
|
226 | + */ |
|
215 | 227 | public function packBin($str) |
216 | 228 | { |
217 | 229 | $length = \strlen($str); |
@@ -237,6 +249,9 @@ discard block |
||
237 | 249 | return $data; |
238 | 250 | } |
239 | 251 | |
252 | + /** |
|
253 | + * @param integer $size |
|
254 | + */ |
|
240 | 255 | public function packArrayHeader($size) |
241 | 256 | { |
242 | 257 | if ($size <= 0xf) { |
@@ -281,6 +296,9 @@ discard block |
||
281 | 296 | return $data; |
282 | 297 | } |
283 | 298 | |
299 | + /** |
|
300 | + * @param integer $size |
|
301 | + */ |
|
284 | 302 | public function packMapHeader($size) |
285 | 303 | { |
286 | 304 | if ($size <= 0xf) { |
@@ -293,6 +311,10 @@ discard block |
||
293 | 311 | return \pack('CN', 0xdf, $size); |
294 | 312 | } |
295 | 313 | |
314 | + /** |
|
315 | + * @param integer $type |
|
316 | + * @param string $data |
|
317 | + */ |
|
296 | 318 | public function packExt($type, $data) |
297 | 319 | { |
298 | 320 | $length = \strlen($data); |