Completed
Push — deps ( e2dd1d...0da543 )
by Marc
03:47
created
src/EnumSerializableTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@
 block discarded – undo
53 53
         $name      = \array_search($value, $constants, true);
54 54
         if ($name === false) {
55 55
             $message = \is_scalar($value)
56
-                ? 'Unknown value ' . \var_export($value, true)
57
-                : 'Invalid value of type ' . (\is_object($value) ? \get_class($value) : \gettype($value));
56
+                ? 'Unknown value '.\var_export($value, true)
57
+                : 'Invalid value of type '.(\is_object($value) ? \get_class($value) : \gettype($value));
58 58
             throw new RuntimeException($message);
59 59
         }
60 60
 
61 61
         $class      = static::class;
62 62
         $enumerator = $this;
63
-        $closure    = function () use ($class, $name, $value, $enumerator) {
63
+        $closure    = function() use ($class, $name, $value, $enumerator) {
64 64
             if ($value !== null && $this->value !== null) {
65 65
                 throw new LogicException('Do not call this directly - please use unserialize($enum) instead');
66 66
             }
Please login to merge, or discard this patch.
src/Enum.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 'Unknown value %s for enumeration %s',
209 209
                 \is_scalar($value)
210 210
                     ? \var_export($value, true)
211
-                    : 'of type ' . (\is_object($value) ? \get_class($value) : \gettype($value)),
211
+                    : 'of type '.(\is_object($value) ? \get_class($value) : \gettype($value)),
212 212
                 static::class
213 213
             ));
214 214
         }
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
             return $instance;
237 237
         }
238 238
 
239
-        $const = static::class . "::{$name}";
239
+        $const = static::class."::{$name}";
240 240
         if (!\defined($const)) {
241 241
             throw new InvalidArgumentException("{$const} not defined");
242 242
         }
243 243
 
244 244
         assert(
245 245
             self::noAmbiguousValues(static::getConstants()),
246
-            'Ambiguous enumerator values detected for ' . static::class
246
+            'Ambiguous enumerator values detected for '.static::class
247 247
         );
248 248
 
249 249
         return self::$instances[static::class][$name] = new static(\constant($const));
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             // Enumerators must be defined as public class constants
350 350
             foreach ($reflection->getReflectionConstants() as $reflConstant) {
351 351
                 if ($reflConstant->isPublic()) {
352
-                    $scopeConstants[ $reflConstant->getName() ] = $reflConstant->getValue();
352
+                    $scopeConstants[$reflConstant->getName()] = $reflConstant->getValue();
353 353
                 }
354 354
             }
355 355
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
         assert(
360 360
             self::noAmbiguousValues($constants),
361
-            'Ambiguous enumerator values detected for ' . static::class
361
+            'Ambiguous enumerator values detected for '.static::class
362 362
         );
363 363
 
364 364
         self::$names[static::class] = \array_keys($constants);
Please login to merge, or discard this patch.
src/EnumMap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@
 block discarded – undo
63 63
      * @return array<string, mixed>
64 64
      */
65 65
     public function __debugInfo(): array {
66
-        $dbg = (array)$this;
67
-        $dbg["\0" . self::class . "\0__pairs"] = array_map(function ($k, $v) {
66
+        $dbg = (array) $this;
67
+        $dbg["\0".self::class."\0__pairs"] = array_map(function($k, $v) {
68 68
             return [$k, $v];
69 69
         }, $this->getKeys(), $this->getValues());
70 70
         return $dbg;
Please login to merge, or discard this patch.
src/EnumSet.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         // we will switch this into a binary bitset
105 105
         if ($this->enumerationCount > \PHP_INT_SIZE * 8) {
106 106
             // init binary bitset with zeros
107
-            $this->bitset = $this->emptyBitset = \str_repeat("\0", (int)\ceil($this->enumerationCount / 8));
107
+            $this->bitset = $this->emptyBitset = \str_repeat("\0", (int) \ceil($this->enumerationCount / 8));
108 108
 
109 109
             // switch internal binary bitset functions
110 110
             $this->fnDoGetIterator       = 'doGetIteratorBin';
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
      * @return array<string, mixed>
135 135
      */
136 136
     public function __debugInfo() {
137
-        $dbg = (array)$this;
138
-        $dbg["\0" . self::class . "\0__enumerators"] = $this->getValues();
137
+        $dbg = (array) $this;
138
+        $dbg["\0".self::class."\0__enumerators"] = $this->getValues();
139 139
         return $dbg;
140 140
     }
141 141
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                 throw new InvalidArgumentException('out-of-range bits detected');
369 369
             }
370 370
 
371
-            $this->bitset = \substr($bitset, 0, -1) . $lastByteExpected;
371
+            $this->bitset = \substr($bitset, 0, -1).$lastByteExpected;
372 372
         }
373 373
 
374 374
         $this->bitset = $bitset;
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
     private function doGetBinaryBitsetLeInt()
1123 1123
     {
1124 1124
         $bin = \pack(\PHP_INT_SIZE === 8 ? 'P' : 'V', $this->bitset);
1125
-        return \substr($bin, 0, (int)\ceil($this->enumerationCount / 8));
1125
+        return \substr($bin, 0, (int) \ceil($this->enumerationCount / 8));
1126 1126
     }
1127 1127
 
1128 1128
     /**
@@ -1186,6 +1186,6 @@  discard block
 block discarded – undo
1186 1186
         /** @var int $bitset */
1187 1187
         $bitset = $this->bitset;
1188 1188
 
1189
-        return (bool)($bitset & (1 << $ordinal));
1189
+        return (bool) ($bitset & (1 << $ordinal));
1190 1190
     }
1191 1191
 }
Please login to merge, or discard this patch.