Completed
Pull Request — master (#118)
by Charlotte
02:02
created
src/Utils/BitManipulation.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * For the full license, take a look to the LICENSE file
9 9
  * on the root directory of this project
10 10
  */
11
-declare(strict_types=1);
11
+declare(strict_types = 1);
12 12
 
13 13
 namespace Nekland\Woketo\Utils;
14 14
 use Nekland\Woketo\Exception\Utils\NotLongEnoughException;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         if (\is_string($frame)) {
66 66
             $len = BitManipulation::frameSize($frame);
67 67
 
68
-            if ($byteNumber < 0 || $byteNumber > ($len-1)) {
68
+            if ($byteNumber < 0 || $byteNumber > ($len - 1)) {
69 69
                 throw new \InvalidArgumentException(
70 70
                     \sprintf('The frame is only %s bytes larges but you tried to get the %sth byte.', $len, $byteNumber)
71 71
                 );
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             $res = 0;
174 174
 
175 175
             // for each byte, getting ord
176
-            for($i = 0; $i < $subStringLength; $i++) {
176
+            for ($i = 0; $i < $subStringLength; $i++) {
177 177
                 $res <<= 8;
178 178
                 $res += \ord($subString[$i]);
179 179
             }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     {
230 230
         $format = '*';
231 231
 
232
-        switch(true) {
232
+        switch (true) {
233 233
             case $size <= 2:
234 234
                 $format = 'n*';
235 235
                 break;
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
 
263 263
         $format = '*';
264 264
 
265
-        switch(true) {
265
+        switch (true) {
266 266
             case $len <= 2:
267
-                $format = 'n';break;
267
+                $format = 'n'; break;
268 268
             case $len <= 4:
269
-                $format = 'N';break;
269
+                $format = 'N'; break;
270 270
             case $len > 4:
271
-                $format = 'J';break;
271
+                $format = 'J'; break;
272 272
         }
273 273
 
274 274
         return unpack($format, $frame)[1];
Please login to merge, or discard this patch.