@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | public static function create(array $bits): int |
| 17 | 17 | { |
| 18 | 18 | $result = 0; |
| 19 | - foreach($bits as $code) { |
|
| 19 | + foreach ($bits as $code) { |
|
| 20 | 20 | $result += 2**$code; |
| 21 | 21 | } |
| 22 | 22 | return $result; |
@@ -32,12 +32,12 @@ discard block |
||
| 32 | 32 | $result = []; |
| 33 | 33 | $i = 0; |
| 34 | 34 | |
| 35 | - while($bitmap) { |
|
| 36 | - if($bitmap % 2) { |
|
| 35 | + while ($bitmap) { |
|
| 36 | + if ($bitmap%2) { |
|
| 37 | 37 | $result[] = $i; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $bitmap = (int)($bitmap / 2); |
|
| 40 | + $bitmap = (int) ($bitmap/2); |
|
| 41 | 41 | ++$i; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public static function intersects($lhs, $rhs): bool |
| 55 | 55 | { |
| 56 | - if(is_array($lhs)) { |
|
| 56 | + if (is_array($lhs)) { |
|
| 57 | 57 | $lhs = static::create($lhs); |
| 58 | 58 | } |
| 59 | - if(is_array($rhs)) { |
|
| 59 | + if (is_array($rhs)) { |
|
| 60 | 60 | $rhs = static::create($rhs); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public static function includes($haystack, $needle): bool |
| 73 | 73 | { |
| 74 | - if(is_array($haystack)) { |
|
| 74 | + if (is_array($haystack)) { |
|
| 75 | 75 | $haystack = static::create($haystack); |
| 76 | 76 | } |
| 77 | - if(is_array($needle)) { |
|
| 77 | + if (is_array($needle)) { |
|
| 78 | 78 | $needle = static::create($needle); |
| 79 | 79 | } |
| 80 | 80 | |