@@ -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 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $regexBase = '/(is|set)(%s)/m'; |
| 40 | 40 | $regexFull = sprintf($regexBase, implode('|', array_keys($array))); |
| 41 | 41 | preg_match($regexFull, $name, $match); |
| 42 | - if (count($match)>0 && $match[0] === $name) { |
|
| 42 | + if (count($match) > 0 && $match[0] === $name) { |
|
| 43 | 43 | return $this->{$match[1] . 'Flag'}($array[$match[2]], $arguments[0] ?? true); |
| 44 | 44 | } |
| 45 | 45 | throw new BadMethodCallException(sprintf('Enum %s not found on %s', $name, get_class($this))); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $firstTime = !isset(static::$cache[static::class]); |
| 65 | 65 | $array = parent::toArray(); |
| 66 | - $firstTime && array_walk($array, function ($item) { |
|
| 66 | + $firstTime && array_walk($array, function($item) { |
|
| 67 | 67 | if (!is_integer($item)) { |
| 68 | 68 | throw new UnexpectedValueException( |
| 69 | 69 | sprintf('All defined Const on Enum %s should be integers', static::class) |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | public function getKey() |
| 80 | 80 | { |
| 81 | 81 | $value = $this->value; |
| 82 | - $f = array_filter(static::toArray(), function () use (&$value) { |
|
| 82 | + $f = array_filter(static::toArray(), function() use (&$value) { |
|
| 83 | 83 | $isSet = $value & 1; |
| 84 | 84 | $value = $value >> 1; |
| 85 | 85 | return $isSet; |