Passed
Pull Request — master (#1448)
by Asmir
02:55
created
src/Metadata/Driver/EnumPropertiesDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
     {
75 75
         $reflectionType = $propertyReflection->getType();
76 76
 
77
-        if (!($reflectionType instanceof \ReflectionNamedType)) {
77
+        if ( ! ($reflectionType instanceof \ReflectionNamedType)) {
78 78
             return null;
79 79
         }
80 80
 
Please login to merge, or discard this patch.
src/Handler/EnumHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         SerializationContext $context
46 46
     ) {
47 47
         if (isset($type['params'][1]) && 'value' === $type['params'][1]) {
48
-            if (!$enum instanceof \BackedEnum) {
48
+            if ( ! $enum instanceof \BackedEnum) {
49 49
                 throw new InvalidMetadataException(sprintf('The type "%s" is not a backed enum, thus you can not use "value" as serialization mode for its value.', get_class($enum)));
50 50
             }
51 51
 
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
         $caseValue = (string) $data;
68 68
 
69 69
         $ref = new \ReflectionEnum($enumType);
70
-        if (isset($type['params'][1]) && 'value' === $type['params'][1] || (!isset($type['params'][1]) && is_a($enumType, \BackedEnum::class, true))) {
71
-            if (!is_a($enumType, \BackedEnum::class, true)) {
70
+        if (isset($type['params'][1]) && 'value' === $type['params'][1] || ( ! isset($type['params'][1]) && is_a($enumType, \BackedEnum::class, true))) {
71
+            if ( ! is_a($enumType, \BackedEnum::class, true)) {
72 72
                 throw new InvalidMetadataException(sprintf('The type "%s" is not a backed enum, thus you can not use "value" as serialization mode for its value.', $enumType));
73 73
             }
74 74
 
75 75
             if ('int' === $ref->getBackingType()->getName()) {
76
-                if (!is_numeric($caseValue)) {
76
+                if ( ! is_numeric($caseValue)) {
77 77
                     throw new RuntimeException(sprintf('"%s" is not a valid backing value for enum "%s"', $caseValue, $enumType));
78 78
                 }
79 79
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
             return $enumType::from($caseValue);
84 84
         } else {
85
-            if (!$ref->hasCase($caseValue)) {
85
+            if ( ! $ref->hasCase($caseValue)) {
86 86
                 throw new InvalidMetadataException(sprintf('The type "%s" does not have the case "%s"', $ref->getName(), $caseValue));
87 87
             }
88 88
 
Please login to merge, or discard this patch.
src/EventDispatcher/Subscriber/EnumSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     {
14 14
         $type = $event->getType();
15 15
 
16
-        if (isset($type['name']) && ('enum' === $type['name'] || !is_a($type['name'], \UnitEnum::class, true))) {
16
+        if (isset($type['name']) && ('enum' === $type['name'] || ! is_a($type['name'], \UnitEnum::class, true))) {
17 17
             return;
18 18
         }
19 19
 
Please login to merge, or discard this patch.