Passed
Pull Request — master (#1553)
by
unknown
02:33
created
src/Handler/UnionHandler.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
             if ($data[$type['params'][0]]) {
73 73
                 $lookupField = $type['params'][0];
74 74
 
75
-                if (!array_key_exists($lookupField, $data)) {
76
-                    throw new NonVisitableTypeException('Union Discriminator Field \'' . $lookupField . '\' not found in data');
75
+                if ( ! array_key_exists($lookupField, $data)) {
76
+                    throw new NonVisitableTypeException('Union Discriminator Field \''.$lookupField.'\' not found in data');
77 77
                 }
78 78
 
79 79
                 $lkup = $data[$lookupField];
@@ -83,23 +83,23 @@  discard block
 block discarded – undo
83 83
                 ];
84 84
             }
85 85
         } elseif (2 === count($type['params'])) {
86
-            if (is_array($type['params'][1]) && !array_key_exists('name', $type['params'][1])) {
86
+            if (is_array($type['params'][1]) && ! array_key_exists('name', $type['params'][1])) {
87 87
                 $lookupField = $type['params'][0];
88 88
                 $unionMap = $type['params'][1];
89 89
 
90
-                if (!array_key_exists($lookupField, $data)) {
91
-                    throw new NonVisitableTypeException('Union Discriminator Field \'' . $lookupField . '\' not found in data');
90
+                if ( ! array_key_exists($lookupField, $data)) {
91
+                    throw new NonVisitableTypeException('Union Discriminator Field \''.$lookupField.'\' not found in data');
92 92
                 }
93 93
 
94 94
                 $lkup = $data[$lookupField];
95
-                if (!empty($unionMap)) {
95
+                if ( ! empty($unionMap)) {
96 96
                     if (array_key_exists($lkup, $unionMap)) {
97 97
                         $finalType = [
98 98
                             'name' => $unionMap[$lkup],
99 99
                             'params' => [],
100 100
                         ];
101 101
                     } else {
102
-                        throw new NonVisitableTypeException('Union Discriminator Map does not contain key \'' . $lkup . '\'');
102
+                        throw new NonVisitableTypeException('Union Discriminator Map does not contain key \''.$lkup.'\'');
103 103
                     }
104 104
                 } else {
105 105
                     $finalType = [
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     private function matchSimpleType(mixed $data, array $type, Context $context): mixed
129 129
     {
130 130
         foreach ($type['params'] as $possibleType) {
131
-            if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) {
131
+            if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat())) {
132 132
                 continue;
133 133
             }
134 134
 
Please login to merge, or discard this patch.