@@ -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); |