@@ -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 |
@@ -185,6 +191,9 @@ discard block |
||
| 185 | 191 | : "\xcb".\pack('E', $float); |
| 186 | 192 | } |
| 187 | 193 | |
| 194 | + /** |
|
| 195 | + * @param string $str |
|
| 196 | + */ |
|
| 188 | 197 | public function packStr($str) |
| 189 | 198 | { |
| 190 | 199 | $length = \strlen($str); |
@@ -202,6 +211,9 @@ discard block |
||
| 202 | 211 | return \pack('CN', 0xdb, $length).$str; |
| 203 | 212 | } |
| 204 | 213 | |
| 214 | + /** |
|
| 215 | + * @param string $str |
|
| 216 | + */ |
|
| 205 | 217 | public function packBin($str) |
| 206 | 218 | { |
| 207 | 219 | $length = \strlen($str); |
@@ -227,6 +239,9 @@ discard block |
||
| 227 | 239 | return $data; |
| 228 | 240 | } |
| 229 | 241 | |
| 242 | + /** |
|
| 243 | + * @param integer $size |
|
| 244 | + */ |
|
| 230 | 245 | public function packArrayHeader($size) |
| 231 | 246 | { |
| 232 | 247 | if ($size <= 0xf) { |
@@ -271,6 +286,9 @@ discard block |
||
| 271 | 286 | return $data; |
| 272 | 287 | } |
| 273 | 288 | |
| 289 | + /** |
|
| 290 | + * @param integer $size |
|
| 291 | + */ |
|
| 274 | 292 | public function packMapHeader($size) |
| 275 | 293 | { |
| 276 | 294 | if ($size <= 0xf) { |
@@ -283,6 +301,9 @@ discard block |
||
| 283 | 301 | return \pack('CN', 0xdf, $size); |
| 284 | 302 | } |
| 285 | 303 | |
| 304 | + /** |
|
| 305 | + * @param integer $type |
|
| 306 | + */ |
|
| 286 | 307 | public function packExt($type, $data) |
| 287 | 308 | { |
| 288 | 309 | $length = \strlen($data); |