Passed
Pull Request — master (#8)
by Alex
01:51
created
src/BitMask.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         if ($value) {
24 24
             $this->value = 0 === $flag ? 0 : $this->value | $flag;
25 25
         } else {
26
-            $this->value = 0 === $flag  ? $this->value : $this->value & ~$flag;
26
+            $this->value = 0 === $flag ? $this->value : $this->value & ~$flag;
27 27
         }
28 28
         return $this;
29 29
     }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $regexBase = '/(is|set)(%s)/m';
41 41
         $regexFull = sprintf($regexBase, implode('|', array_keys($array)));
42 42
         preg_match($regexFull, $name, $match);
43
-        if (count($match)>0 && $match[0] === $name) {
43
+        if (count($match) > 0 && $match[0] === $name) {
44 44
             return $this->{$match[1] . 'Flag'}($array[$match[2]], $arguments[0] ?? true);
45 45
         }
46 46
         throw new BadMethodCallException(sprintf('Enum %s not found on %s', $name, get_class($this)));
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
     public static function toArray()
66 66
     {
67 67
         $firstTime = !isset(static::$cache[static::class]);
68
-        $array     = array_filter(parent::toArray(), function ($value): bool {
68
+        $array     = array_filter(parent::toArray(), function($value): bool {
69 69
             return is_scalar($value);
70 70
         });
71
-        $firstTime && array_walk($array, function ($item): void {
71
+        $firstTime && array_walk($array, function($item): void {
72 72
             if (!is_integer($item)) {
73 73
                 throw new UnexpectedValueException(
74 74
                     sprintf('All defined Const on Enum %s should be integers', static::class)
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function getKey()
85 85
     {
86 86
         $value = $this->value;
87
-        $f     = array_filter(static::toArray(), function () use (&$value) {
87
+        $f     = array_filter(static::toArray(), function() use (&$value) {
88 88
             $isSet = $value & 1;
89 89
             $value = $value >> 1;
90 90
             return $isSet;
Please login to merge, or discard this patch.