@@ -23,7 +23,7 @@ discard block |
||
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 |
||
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 |
||
65 | 65 | public static function toArray(): array |
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) |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function getKey() |
86 | 86 | { |
87 | 87 | $value = $this->value; |
88 | - $f = array_filter(static::toArray(), function () use (&$value) { |
|
88 | + $f = array_filter(static::toArray(), function() use (&$value) { |
|
89 | 89 | $isSet = $value & 1; |
90 | 90 | $value = $value >> 1; |
91 | 91 | return $isSet; |