Completed
Branch master (4590b3)
by Jarddel
02:54
created
src/EnumTrait.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -180,8 +180,8 @@
 block discarded – undo
180 180
     }
181 181
 
182 182
     /**
183
-    * Assigns the constants of the enumerative class.
184
-    */
183
+     * Assigns the constants of the enumerative class.
184
+     */
185 185
     protected static function assignConstants()
186 186
     {
187 187
         static::$constants = array_keys((new \ReflectionClass(static::class))->getConstants());
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         try {
128 128
             return self::getEnumByValue($constant, static::$constants);
129
-        } catch(\InvalidArgumentException $exception) {
129
+        } catch (\InvalidArgumentException $exception) {
130 130
             throw $exception;
131 131
         }
132 132
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
         try {
146 146
             return self::getEnumByValue($constant, static::$descriptions);
147
-        } catch(\InvalidArgumentException $exception) {
147
+        } catch (\InvalidArgumentException $exception) {
148 148
             throw $exception;
149 149
         }
150 150
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             return $enum;
169 169
         }
170 170
 
171
-        throw new \InvalidArgumentException("Invalid Value! Only enumerative values ​​of the type:". static::class);
171
+        throw new \InvalidArgumentException("Invalid Value! Only enumerative values ​​of the type:".static::class);
172 172
     }
173 173
 
174 174
     /**
Please login to merge, or discard this patch.
src/EnumType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         static::assignValues();
27 27
 
28
-        return "ENUM(".implode(", ", static::$descriptions ? : static::$values).")";
28
+        return "ENUM(".implode(", ", static::$descriptions ?: static::$values).")";
29 29
     }
30 30
 
31 31
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     protected function getInstance(): EnumInterface
57 57
     {
58
-        $type = strtolower(preg_replace(['(.*[\\\/])','/Enum|Type/','/(?<!^)[A-Z]/'], ['','','_$0'], static::class));
58
+        $type = strtolower(preg_replace(['(.*[\\\/])', '/Enum|Type/', '/(?<!^)[A-Z]/'], ['', '', '_$0'], static::class));
59 59
 
60 60
         return static::getType($type);
61 61
     }
Please login to merge, or discard this patch.
src/Enum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     use EnumTrait;
14 14
 
15
-    final private function __construct(){}
15
+    final private function __construct() {}
16 16
 
17 17
     /**
18 18
      * Get the instance of the enumerative class
Please login to merge, or discard this patch.