Completed
Branch transformers (91245b)
by Eugene
05:05
created
src/Packer.php 1 patch
Doc Comments   +18 added lines patch added patch discarded remove patch
@@ -151,6 +151,9 @@  discard block
 block discarded – undo
151 151
         return $data;
152 152
     }
153 153
 
154
+    /**
155
+     * @param string $str
156
+     */
154 157
     public function packStr($str)
155 158
     {
156 159
         $len = \strlen($str);
@@ -209,21 +212,33 @@  discard block
 block discarded – undo
209 212
         return "\xc0";
210 213
     }
211 214
 
215
+    /**
216
+     * @param boolean $val
217
+     */
212 218
     public function packBool($val)
213 219
     {
214 220
         return $val ? "\xc3" : "\xc2";
215 221
     }
216 222
 
223
+    /**
224
+     * @param double $num
225
+     */
217 226
     public function packFloat32($num)
218 227
     {
219 228
         return "\xca".\strrev(\pack('f', $num));
220 229
     }
221 230
 
231
+    /**
232
+     * @param double $num
233
+     */
222 234
     public function packFloat64($num)
223 235
     {
224 236
         return "\xcb".\strrev(\pack('d', $num));
225 237
     }
226 238
 
239
+    /**
240
+     * @param integer $num
241
+     */
227 242
     public function packInt($num)
228 243
     {
229 244
         if ($num >= 0) {
@@ -259,6 +274,9 @@  discard block
 block discarded – undo
259 274
         return self::packUint64(0xd3, $num);
260 275
     }
261 276
 
277
+    /**
278
+     * @param integer $code
279
+     */
262 280
     private static function packUint64($code, $num)
263 281
     {
264 282
         $hi = ($num & 0xffffffff00000000) >> 32;
Please login to merge, or discard this patch.