Passed
Pull Request — master (#900)
by Michael
03:15
created
src/JsonDeserializationVisitor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,32 +53,32 @@  discard block
 block discarded – undo
53 53
 
54 54
     public function visitString($data, array $type): string
55 55
     {
56
-        return (string)$data;
56
+        return (string) $data;
57 57
     }
58 58
 
59 59
     public function visitBoolean($data, array $type): bool
60 60
     {
61
-        return (bool)$data;
61
+        return (bool) $data;
62 62
     }
63 63
 
64 64
     public function visitInteger($data, array $type): int
65 65
     {
66
-        return (int)$data;
66
+        return (int) $data;
67 67
     }
68 68
 
69 69
     public function visitDouble($data, array $type): float
70 70
     {
71
-        return (double)$data;
71
+        return (double) $data;
72 72
     }
73 73
 
74 74
     public function visitArray($data, array $type): array
75 75
     {
76
-        if (!\is_array($data)) {
76
+        if ( ! \is_array($data)) {
77 77
             throw new RuntimeException(sprintf('Expected array, but got %s: %s', \gettype($data), json_encode($data)));
78 78
         }
79 79
 
80 80
         // If no further parameters were given, keys/values are just passed as is.
81
-        if (!$type['params']) {
81
+        if ( ! $type['params']) {
82 82
             return $data;
83 83
         }
84 84
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     public function visitDiscriminatorMapProperty($data, ClassMetadata $metadata): string
114 114
     {
115 115
         if (isset($data[$metadata->discriminatorFieldName])) {
116
-            return (string)$data[$metadata->discriminatorFieldName];
116
+            return (string) $data[$metadata->discriminatorFieldName];
117 117
         }
118 118
 
119 119
         throw new LogicException(sprintf(
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
             return;
137 137
         }
138 138
 
139
-        if (!\is_array($data)) {
139
+        if ( ! \is_array($data)) {
140 140
             throw new RuntimeException(sprintf('Invalid data "%s"(%s), expected "%s".', $data, $metadata->type['name'], $metadata->reflection->class));
141 141
         }
142 142
 
143
-        if (!array_key_exists($name, $data)) {
143
+        if ( ! array_key_exists($name, $data)) {
144 144
             return;
145 145
         }
146 146
 
147
-        if (!$metadata->type) {
147
+        if ( ! $metadata->type) {
148 148
             throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name));
149 149
         }
150 150
 
Please login to merge, or discard this patch.
src/Exclusion/GroupsExclusionStrategy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
     {
56 56
         $groups = $this->getGroupsFor($navigatorContext);
57 57
 
58
-        if (!$property->groups) {
59
-            return !in_array(self::DEFAULT_GROUP, $groups);
58
+        if ( ! $property->groups) {
59
+            return ! in_array(self::DEFAULT_GROUP, $groups);
60 60
         }
61 61
 
62 62
         return $this->shouldSkipUsingGroups($property, $groups);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         $groups = $this->groups;
81 81
         foreach ($paths as $index => $path) {
82
-            if (!array_key_exists($path, $groups)) {
82
+            if ( ! array_key_exists($path, $groups)) {
83 83
                 if ($index > 0) {
84 84
                     $groups = array(self::DEFAULT_GROUP);
85 85
                 }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                 break;
88 88
             }
89 89
 
90
-            if (!is_array($groups[$path])) {
90
+            if ( ! is_array($groups[$path])) {
91 91
                 throw new RuntimeException(sprintf('The group value for the property path "%s" should be an array, "%s" given', $index, gettype($groups[$path])));
92 92
             }
93 93
 
Please login to merge, or discard this patch.
src/Context.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $this->addExclusionStrategy(new VersionExclusionStrategy($this->attributes['version']));
90 90
         }
91 91
 
92
-        if (!empty($this->attributes['max_depth_checks'])) {
92
+        if ( ! empty($this->attributes['max_depth_checks'])) {
93 93
             $this->addExclusionStrategy(new DepthExclusionStrategy());
94 94
         }
95 95
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     private function assertMutable(): void
138 138
     {
139
-        if (!$this->initialized) {
139
+        if ( ! $this->initialized) {
140 140
             return;
141 141
         }
142 142
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             throw new LogicException('The groups must not be empty.');
169 169
         }
170 170
 
171
-        $this->attributes['groups'] = (array)$groups;
171
+        $this->attributes['groups'] = (array) $groups;
172 172
 
173 173
         return $this;
174 174
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     {
226 226
         $metadata = $this->metadataStack->pop();
227 227
 
228
-        if (!$metadata instanceof PropertyMetadata) {
228
+        if ( ! $metadata instanceof PropertyMetadata) {
229 229
             throw new RuntimeException('Context metadataStack not working well');
230 230
         }
231 231
     }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     {
235 235
         $metadata = $this->metadataStack->pop();
236 236
 
237
-        if (!$metadata instanceof ClassMetadata) {
237
+        if ( ! $metadata instanceof ClassMetadata) {
238 238
             throw new RuntimeException('Context metadataStack not working well');
239 239
         }
240 240
     }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function getCurrentPath()
251 251
     {
252
-        if (!$this->metadataStack) {
252
+        if ( ! $this->metadataStack) {
253 253
             return array();
254 254
         }
255 255
 
Please login to merge, or discard this patch.
src/EventDispatcher/EventDispatcher.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public static function getDefaultMethodName($eventName)
39 39
     {
40
-        return 'on' . str_replace(array('_', '.'), '', $eventName);
40
+        return 'on'.str_replace(array('_', '.'), '', $eventName);
41 41
     }
42 42
 
43 43
     /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function addSubscriber(EventSubscriberInterface $subscriber)
61 61
     {
62 62
         foreach ($subscriber->getSubscribedEvents() as $eventData) {
63
-            if (!isset($eventData['event'])) {
63
+            if ( ! isset($eventData['event'])) {
64 64
                 throw new InvalidArgumentException(sprintf('Each event must have a "event" key.'));
65 65
             }
66 66
 
@@ -75,30 +75,30 @@  discard block
 block discarded – undo
75 75
 
76 76
     public function hasListeners($eventName, $class, $format)
77 77
     {
78
-        if (!isset($this->listeners[$eventName])) {
78
+        if ( ! isset($this->listeners[$eventName])) {
79 79
             return false;
80 80
         }
81 81
 
82
-        if (!isset($this->classListeners[$eventName][$class][$format])) {
82
+        if ( ! isset($this->classListeners[$eventName][$class][$format])) {
83 83
             $this->classListeners[$eventName][$class][$format] = $this->initializeListeners($eventName, $class, $format);
84 84
         }
85 85
 
86
-        return !!$this->classListeners[$eventName][$class][$format];
86
+        return ! ! $this->classListeners[$eventName][$class][$format];
87 87
     }
88 88
 
89 89
     public function dispatch($eventName, $class, $format, Event $event)
90 90
     {
91
-        if (!isset($this->listeners[$eventName])) {
91
+        if ( ! isset($this->listeners[$eventName])) {
92 92
             return;
93 93
         }
94 94
 
95 95
         $object = $event instanceof ObjectEvent ? $event->getObject() : null;
96
-        $objectClass = $object ? (get_class($object) . $class) : $class;
96
+        $objectClass = $object ? (get_class($object).$class) : $class;
97 97
 
98
-        if (!isset($this->classListeners[$eventName][$objectClass][$format])) {
98
+        if ( ! isset($this->classListeners[$eventName][$objectClass][$format])) {
99 99
             $this->classListeners[$eventName][$objectClass][$format] = array();
100 100
             foreach ($this->initializeListeners($eventName, $class, $format) as $listener) {
101
-                if ($listener[3] !== null && !($object instanceof $listener[3])) {
101
+                if ($listener[3] !== null && ! ($object instanceof $listener[3])) {
102 102
                     continue;
103 103
                 }
104 104
 
Please login to merge, or discard this patch.
src/EventDispatcher/LazyEventDispatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function __construct($container)
32 32
     {
33
-        if (!$container instanceof PsrContainerInterface && !$container instanceof ContainerInterface) {
33
+        if ( ! $container instanceof PsrContainerInterface && ! $container instanceof ContainerInterface) {
34 34
             throw new InvalidArgumentException(sprintf('The container must be an instance of %s or %s (%s given).', PsrContainerInterface::class, ContainerInterface::class, \is_object($container) ? \get_class($container) : \gettype($container)));
35 35
         }
36 36
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
         $listeners = parent::initializeListeners($eventName, $loweredClass, $format);
46 46
 
47 47
         foreach ($listeners as &$listener) {
48
-            if (!\is_array($listener[0]) || !\is_string($listener[0][0])) {
48
+            if ( ! \is_array($listener[0]) || ! \is_string($listener[0][0])) {
49 49
                 continue;
50 50
             }
51 51
 
52
-            if (!$this->container->has($listener[0][0])) {
52
+            if ( ! $this->container->has($listener[0][0])) {
53 53
                 continue;
54 54
             }
55 55
 
Please login to merge, or discard this patch.
src/SerializationGraphNavigator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -130,33 +130,33 @@
 block discarded – undo
130 130
 
131 131
         switch ($type['name']) {
132 132
             case 'NULL':
133
-                if (!$this->shouldSerializeNull) {
133
+                if ( ! $this->shouldSerializeNull) {
134 134
                     throw new NotAcceptableException();
135 135
                 }
136 136
                 return $this->visitor->visitNull($data, $type);
137 137
 
138 138
             case 'string':
139
-                return $this->visitor->visitString((string)$data, $type);
139
+                return $this->visitor->visitString((string) $data, $type);
140 140
 
141 141
             case 'int':
142 142
             case 'integer':
143
-                return $this->visitor->visitInteger((int)$data, $type);
143
+                return $this->visitor->visitInteger((int) $data, $type);
144 144
 
145 145
             case 'bool':
146 146
             case 'boolean':
147
-                return $this->visitor->visitBoolean((bool)$data, $type);
147
+                return $this->visitor->visitBoolean((bool) $data, $type);
148 148
 
149 149
             case 'double':
150 150
             case 'float':
151
-                return $this->visitor->visitDouble((float)$data, $type);
151
+                return $this->visitor->visitDouble((float) $data, $type);
152 152
 
153 153
             case 'array':
154
-                return $this->visitor->visitArray((array)$data, $type);
154
+                return $this->visitor->visitArray((array) $data, $type);
155 155
 
156 156
             case 'resource':
157 157
                 $msg = 'Resources are not supported in serialized data.';
158 158
                 if (null !== $path = $this->context->getPath()) {
159
-                    $msg .= ' Path: ' . $path;
159
+                    $msg .= ' Path: '.$path;
160 160
                 }
161 161
 
162 162
                 throw new RuntimeException($msg);
Please login to merge, or discard this patch.
src/XmlSerializationVisitor.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function createRoot(ClassMetadata $metadata = null, $rootName = null, $rootNamespace = null)
80 80
     {
81
-        if ($metadata !== null && !empty($metadata->xmlRootName)) {
81
+        if ($metadata !== null && ! empty($metadata->xmlRootName)) {
82 82
             $rootName = $metadata->xmlRootName;
83 83
             $rootNamespace = $metadata->xmlRootNamespace ?: $this->getClassDefaultNamespace($metadata);
84 84
         } else {
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $doCData = null !== $this->currentMetadata ? $this->currentMetadata->xmlElementCData : true;
113 113
 
114
-        return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string)$data);
114
+        return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data);
115 115
     }
116 116
 
117 117
     public function visitSimpleString($data, array $type)
118 118
     {
119
-        return $this->document->createTextNode((string)$data);
119
+        return $this->document->createTextNode((string) $data);
120 120
     }
121 121
 
122 122
     public function visitBoolean(bool $data, array $type)
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     public function visitInteger(int $data, array $type)
128 128
     {
129
-        return $this->document->createTextNode((string)$data);
129
+        return $this->document->createTextNode((string) $data);
130 130
     }
131 131
 
132 132
     public function visitDouble(float $data, array $type)
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         if (floor($data) === $data) {
135 135
             return $this->document->createTextNode($data.".0");
136 136
         } else {
137
-            return $this->document->createTextNode((string)$data);
137
+            return $this->document->createTextNode((string) $data);
138 138
         }
139 139
     }
140 140
 
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
         $elType = $this->getElementType($type);
152 152
         foreach ($data as $k => $v) {
153 153
 
154
-            $tagName = (null !== $this->currentMetadata && $this->currentMetadata->xmlKeyValuePairs && $this->isElementNameValid((string)$k)) ? $k : $entryName;
154
+            $tagName = (null !== $this->currentMetadata && $this->currentMetadata->xmlKeyValuePairs && $this->isElementNameValid((string) $k)) ? $k : $entryName;
155 155
 
156 156
             $entryNode = $this->createElement($tagName, $namespace);
157 157
             $this->currentNode->appendChild($entryNode);
158 158
             $this->setCurrentNode($entryNode);
159 159
 
160 160
             if (null !== $keyAttributeName) {
161
-                $entryNode->setAttribute($keyAttributeName, (string)$k);
161
+                $entryNode->setAttribute($keyAttributeName, (string) $k);
162 162
             }
163 163
 
164 164
             try {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             $node = $this->navigator->accept($v, $metadata->type);
194 194
             $this->revertCurrentMetadata();
195 195
 
196
-            if (!$node instanceof \DOMCharacterData) {
196
+            if ( ! $node instanceof \DOMCharacterData) {
197 197
                 throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v)));
198 198
             }
199 199
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         }
204 204
 
205 205
         if (($metadata->xmlValue && $this->currentNode->childNodes->length > 0)
206
-            || (!$metadata->xmlValue && $this->hasValue)
206
+            || ( ! $metadata->xmlValue && $this->hasValue)
207 207
         ) {
208 208
             throw new RuntimeException(sprintf('If you make use of @XmlValue, all other properties in the class must have the @XmlAttribute annotation. Invalid usage detected in class %s.', $metadata->class));
209 209
         }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $node = $this->navigator->accept($v, $metadata->type);
216 216
             $this->revertCurrentMetadata();
217 217
 
218
-            if (!$node instanceof \DOMCharacterData) {
218
+            if ( ! $node instanceof \DOMCharacterData) {
219 219
                 throw new RuntimeException(sprintf('Unsupported value for property %s::$%s. Expected character data, but got %s.', $metadata->reflection->class, $metadata->reflection->name, \is_object($node) ? \get_class($node) : \gettype($node)));
220 220
             }
221 221
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         }
226 226
 
227 227
         if ($metadata->xmlAttributeMap) {
228
-            if (!\is_array($v)) {
228
+            if ( ! \is_array($v)) {
229 229
                 throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', \gettype($v)));
230 230
             }
231 231
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                 $node = $this->navigator->accept($value, null);
235 235
                 $this->revertCurrentMetadata();
236 236
 
237
-                if (!$node instanceof \DOMCharacterData) {
237
+                if ( ! $node instanceof \DOMCharacterData) {
238 238
                     throw new RuntimeException(sprintf('Unsupported value for a XML attribute map value. Expected character data, but got %s.', json_encode($v)));
239 239
                 }
240 240
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
             return;
245 245
         }
246 246
 
247
-        if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) {
247
+        if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) {
248 248
 
249 249
             $namespace = null !== $metadata->xmlNamespace
250 250
                 ? $metadata->xmlNamespace
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
     private function isSkippableEmptyObject($node, PropertyMetadata $metadata)
296 296
     {
297
-        return $node === null && !$metadata->xmlCollection && $metadata->skipWhenEmpty;
297
+        return $node === null && ! $metadata->xmlCollection && $metadata->skipWhenEmpty;
298 298
     }
299 299
 
300 300
     private function isSkippableCollection(PropertyMetadata $metadata)
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
     private function isElementEmpty(\DOMElement $element)
306 306
     {
307
-        return !$element->hasChildNodes() && !$element->hasAttributes();
307
+        return ! $element->hasChildNodes() && ! $element->hasAttributes();
308 308
     }
309 309
 
310 310
     public function endVisitingObject(ClassMetadata $metadata, object $data, array $type)
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         foreach ($metadata->xmlNamespaces as $prefix => $uri) {
412 412
             $attribute = 'xmlns';
413 413
             if ($prefix !== '') {
414
-                $attribute .= ':' . $prefix;
414
+                $attribute .= ':'.$prefix;
415 415
             } elseif ($element->namespaceURI === $uri) {
416 416
                 continue;
417 417
             }
@@ -427,19 +427,19 @@  discard block
 block discarded – undo
427 427
         if ($this->currentNode->isDefaultNamespace($namespace)) {
428 428
             return $this->document->createElementNS($namespace, $tagName);
429 429
         }
430
-        if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) {
431
-            $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
430
+        if ( ! ($prefix = $this->currentNode->lookupPrefix($namespace)) && ! ($prefix = $this->document->lookupPrefix($namespace))) {
431
+            $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
432 432
         }
433
-        return $this->document->createElementNS($namespace, $prefix . ':' . $tagName);
433
+        return $this->document->createElementNS($namespace, $prefix.':'.$tagName);
434 434
     }
435 435
 
436 436
     private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null)
437 437
     {
438 438
         if (null !== $namespace) {
439
-            if (!$prefix = $node->lookupPrefix($namespace)) {
440
-                $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
439
+            if ( ! $prefix = $node->lookupPrefix($namespace)) {
440
+                $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
441 441
             }
442
-            $node->setAttributeNS($namespace, $prefix . ':' . $name, $value);
442
+            $node->setAttributeNS($namespace, $prefix.':'.$name, $value);
443 443
         } else {
444 444
             $node->setAttribute($name, $value);
445 445
         }
Please login to merge, or discard this patch.
src/Serializer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             $context = $this->serializationContextFactory->createSerializationContext();
163 163
         }
164 164
 
165
-        if (!isset($this->serializationVisitors[$format])) {
165
+        if ( ! isset($this->serializationVisitors[$format])) {
166 166
             throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for serialization.', $format));
167 167
         }
168 168
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             $context = $this->deserializationContextFactory->createDeserializationContext();
182 182
         }
183 183
 
184
-        if (!isset($this->deserializationVisitors[$format])) {
184
+        if ( ! isset($this->deserializationVisitors[$format])) {
185 185
             throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for deserialization.', $format));
186 186
         }
187 187
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $context = $this->serializationContextFactory->createSerializationContext();
203 203
         }
204 204
 
205
-        if (!isset($this->serializationVisitors['json'])) {
205
+        if ( ! isset($this->serializationVisitors['json'])) {
206 206
             throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for fromArray.', 'json'));
207 207
         }
208 208
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $result = $this->visit($navigator, $visitor, $context, $data, 'json', $type);
215 215
         $result = $this->convertArrayObjects($result);
216 216
 
217
-        if (!\is_array($result)) {
217
+        if ( ! \is_array($result)) {
218 218
             throw new RuntimeException(sprintf(
219 219
                 'The input data of type "%s" did not convert to an array, but got a result of type "%s".',
220 220
                 \is_object($data) ? \get_class($data) : \gettype($data),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
             $context = $this->deserializationContextFactory->createDeserializationContext();
235 235
         }
236 236
 
237
-        if (!isset($this->deserializationVisitors['json'])) {
237
+        if ( ! isset($this->deserializationVisitors['json'])) {
238 238
             throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for fromArray.', 'json'));
239 239
         }
240 240
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     private function convertArrayObjects($data)
266 266
     {
267 267
         if ($data instanceof \ArrayObject || $data instanceof \stdClass) {
268
-            $data = (array)$data;
268
+            $data = (array) $data;
269 269
         }
270 270
         if (\is_array($data)) {
271 271
             foreach ($data as $k => $v) {
Please login to merge, or discard this patch.
src/DeserializationGraphNavigator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
                 /** @var $metadata ClassMetadata */
154 154
                 $metadata = $this->metadataFactory->getMetadataForClass($type['name']);
155 155
 
156
-                if ($metadata->usingExpression && !$this->expressionExclusionStrategy) {
156
+                if ($metadata->usingExpression && ! $this->expressionExclusionStrategy) {
157 157
                     throw new ExpressionLanguageRequiredException("To use conditional exclude/expose in {$metadata->name} you must configure the expression language.");
158 158
                 }
159 159
 
160
-                if (!empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) {
160
+                if ( ! empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) {
161 161
                     $metadata = $this->resolveMetadata($data, $metadata);
162 162
                 }
163 163
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                     try {
190 190
                         $v = $this->visitor->visitProperty($propertyMetadata, $data);
191 191
                         $this->accessor->setValue($object, $v, $propertyMetadata);
192
-                    }catch (NotAcceptableException $e){
192
+                    } catch (NotAcceptableException $e) {
193 193
 
194 194
                     }
195 195
                     $this->context->popPropertyMetadata();
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     {
207 207
         $typeValue = $this->visitor->visitDiscriminatorMapProperty($data, $metadata);
208 208
 
209
-        if (!isset($metadata->discriminatorMap[$typeValue])) {
209
+        if ( ! isset($metadata->discriminatorMap[$typeValue])) {
210 210
             throw new LogicException(sprintf(
211 211
                 'The type value "%s" does not exist in the discriminator map of class "%s". Available types: %s',
212 212
                 $typeValue,
Please login to merge, or discard this patch.