Passed
Pull Request — master (#1416)
by
unknown
02:24
created
src/Handler/DateHandler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                     'type' => $type,
48 48
                     'format' => $format,
49 49
                     'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION,
50
-                    'method' => 'serialize' . $type,
50
+                    'method' => 'serialize'.$type,
51 51
                 ];
52 52
             }
53 53
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 'type' => \DateTimeInterface::class,
56 56
                 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION,
57 57
                 'format' => $format,
58
-                'method' => 'deserializeDateTimeFrom' . ucfirst($format),
58
+                'method' => 'deserializeDateTimeFrom'.ucfirst($format),
59 59
             ];
60 60
 
61 61
             $methods[] = [
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     private function parseDateTime($data, array $type, bool $immutable = false): \DateTimeInterface
233 233
     {
234
-        $timezone = !empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone;
234
+        $timezone = ! empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone;
235 235
         $formats = $this->getDeserializationFormats($type);
236 236
 
237 237
         $formatTried = [];
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         throw new RuntimeException(sprintf(
257 257
             'Invalid datetime "%s", expected one of the format %s.',
258 258
             $data,
259
-            '"' . implode('", "', $formatTried) . '"'
259
+            '"'.implode('", "', $formatTried).'"'
260 260
         ));
261 261
     }
262 262
 
@@ -304,15 +304,15 @@  discard block
 block discarded – undo
304 304
         $format = 'P';
305 305
 
306 306
         if (0 < $dateInterval->y) {
307
-            $format .= $dateInterval->y . 'Y';
307
+            $format .= $dateInterval->y.'Y';
308 308
         }
309 309
 
310 310
         if (0 < $dateInterval->m) {
311
-            $format .= $dateInterval->m . 'M';
311
+            $format .= $dateInterval->m.'M';
312 312
         }
313 313
 
314 314
         if (0 < $dateInterval->d) {
315
-            $format .= $dateInterval->d . 'D';
315
+            $format .= $dateInterval->d.'D';
316 316
         }
317 317
 
318 318
         if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
@@ -320,15 +320,15 @@  discard block
 block discarded – undo
320 320
         }
321 321
 
322 322
         if (0 < $dateInterval->h) {
323
-            $format .= $dateInterval->h . 'H';
323
+            $format .= $dateInterval->h.'H';
324 324
         }
325 325
 
326 326
         if (0 < $dateInterval->i) {
327
-            $format .= $dateInterval->i . 'M';
327
+            $format .= $dateInterval->i.'M';
328 328
         }
329 329
 
330 330
         if (0 < $dateInterval->s) {
331
-            $format .= $dateInterval->s . 'S';
331
+            $format .= $dateInterval->s.'S';
332 332
         }
333 333
 
334 334
         if ('P' === $format) {
Please login to merge, or discard this patch.
src/Annotation/Groups.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
             All the other cases should work as expected.
26 26
             The alternative here is to use the explicit syntax  Groups(groups=['value' => '...'])
27 27
         */
28
-        if (count($values) > 0 && ((!isset($values['value']) && !isset($values['groups'])) || count($values) > 1) && 0 === count($groups)) {
28
+        if (count($values) > 0 && (( ! isset($values['value']) && ! isset($values['groups'])) || count($values) > 1) && 0 === count($groups)) {
29 29
             $vars['groups'] = $values;
30 30
             $vars['values'] = [];
31 31
         }
Please login to merge, or discard this patch.
src/Construction/DoctrineObjectConstructor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         // Locate possible ObjectManager
70 70
         $objectManager = $this->managerRegistry->getManagerForClass($metadata->name);
71 71
 
72
-        if (!$objectManager) {
72
+        if ( ! $objectManager) {
73 73
             // No ObjectManager found, proceed with normal deserialization
74 74
             return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
75 75
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         // Managed entity, check for proxy load
86
-        if (!is_array($data) && !(is_object($data) && 'SimpleXMLElement' === get_class($data))) {
86
+        if ( ! is_array($data) && ! (is_object($data) && 'SimpleXMLElement' === get_class($data))) {
87 87
             // Single identifier, load proxy
88 88
             return $objectManager->getReference($metadata->name, $data);
89 89
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         foreach ($classMetadata->getIdentifierFieldNames() as $name) {
96 96
             // Avoid calling objectManager->find if some identification properties are excluded
97
-            if (!isset($metadata->propertyMetadata[$name])) {
97
+            if ( ! isset($metadata->propertyMetadata[$name])) {
98 98
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
99 99
             }
100 100
 
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
106 106
             }
107 107
 
108
-            if (is_array($data) && !array_key_exists($propertyMetadata->serializedName, $data)) {
108
+            if (is_array($data) && ! array_key_exists($propertyMetadata->serializedName, $data)) {
109 109
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
110
-            } elseif (is_object($data) && !property_exists($data, $propertyMetadata->serializedName)) {
110
+            } elseif (is_object($data) && ! property_exists($data, $propertyMetadata->serializedName)) {
111 111
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
112 112
             }
113 113
 
Please login to merge, or discard this patch.
src/Handler/ArrayCollectionHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         }
120 120
 
121 121
         $propertyMetadata = $context->getMetadataStack()->top();
122
-        if (!$propertyMetadata instanceof PropertyMetadata) {
122
+        if ( ! $propertyMetadata instanceof PropertyMetadata) {
123 123
             return $elements;
124 124
         }
125 125
 
@@ -137,18 +137,18 @@  discard block
 block discarded – undo
137 137
             && $classMetadata->isCollectionValuedAssociation($propertyMetadata->name)
138 138
         ) {
139 139
             $existingCollection = $classMetadata->getFieldValue($currentObject, $propertyMetadata->name);
140
-            if (!$existingCollection instanceof OrmPersistentCollection) {
140
+            if ( ! $existingCollection instanceof OrmPersistentCollection) {
141 141
                 return $elements;
142 142
             }
143 143
 
144 144
             foreach ($elements as $element) {
145
-                if (!$existingCollection->contains($element)) {
145
+                if ( ! $existingCollection->contains($element)) {
146 146
                     $existingCollection->add($element);
147 147
                 }
148 148
             }
149 149
 
150 150
             foreach ($existingCollection as $collectionElement) {
151
-                if (!$elements->contains($collectionElement)) {
151
+                if ( ! $elements->contains($collectionElement)) {
152 152
                     $existingCollection->removeElement($collectionElement);
153 153
                 }
154 154
             }
Please login to merge, or discard this patch.
src/Exclusion/DepthExclusionStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $relativeDepth = 0;
29 29
 
30 30
         foreach ($context->getMetadataStack() as $metadata) {
31
-            if (!$metadata instanceof PropertyMetadata) {
31
+            if ( ! $metadata instanceof PropertyMetadata) {
32 32
                 continue;
33 33
             }
34 34
 
Please login to merge, or discard this patch.
src/SerializerBuilder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
     private function getAccessorStrategy(): AccessorStrategyInterface
216 216
     {
217
-        if (!$this->accessorStrategy) {
217
+        if ( ! $this->accessorStrategy) {
218 218
             $this->accessorStrategy = new DefaultAccessorStrategy($this->expressionEvaluator);
219 219
         }
220 220
 
@@ -251,11 +251,11 @@  discard block
 block discarded – undo
251 251
 
252 252
     public function setCacheDir(string $dir): self
253 253
     {
254
-        if (!is_dir($dir)) {
254
+        if ( ! is_dir($dir)) {
255 255
             $this->createDir($dir);
256 256
         }
257 257
 
258
-        if (!is_writable($dir)) {
258
+        if ( ! is_writable($dir)) {
259 259
             throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
260 260
         }
261 261
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     public function setMetadataDirs(array $namespacePrefixToDirMap): self
378 378
     {
379 379
         foreach ($namespacePrefixToDirMap as $dir) {
380
-            if (!is_dir($dir)) {
380
+            if ( ! is_dir($dir)) {
381 381
                 throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
382 382
             }
383 383
         }
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
      */
416 416
     public function addMetadataDir(string $dir, string $namespacePrefix = ''): self
417 417
     {
418
-        if (!is_dir($dir)) {
418
+        if ( ! is_dir($dir)) {
419 419
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
420 420
         }
421 421
 
@@ -454,11 +454,11 @@  discard block
 block discarded – undo
454 454
      */
455 455
     public function replaceMetadataDir(string $dir, string $namespacePrefix = ''): self
456 456
     {
457
-        if (!is_dir($dir)) {
457
+        if ( ! is_dir($dir)) {
458 458
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
459 459
         }
460 460
 
461
-        if (!isset($this->metadataDirs[$namespacePrefix])) {
461
+        if ( ! isset($this->metadataDirs[$namespacePrefix])) {
462 462
             throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix));
463 463
         }
464 464
 
@@ -553,23 +553,23 @@  discard block
 block discarded – undo
553 553
         if (null !== $this->metadataCache) {
554 554
             $metadataFactory->setCache($this->metadataCache);
555 555
         } elseif (null !== $this->cacheDir) {
556
-            $this->createDir($this->cacheDir . '/metadata');
557
-            $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata'));
556
+            $this->createDir($this->cacheDir.'/metadata');
557
+            $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata'));
558 558
         }
559 559
 
560
-        if (!$this->handlersConfigured) {
560
+        if ( ! $this->handlersConfigured) {
561 561
             $this->addDefaultHandlers();
562 562
         }
563 563
 
564
-        if (!$this->listenersConfigured) {
564
+        if ( ! $this->listenersConfigured) {
565 565
             $this->addDefaultListeners();
566 566
         }
567 567
 
568
-        if (!$this->serializationVisitorsAdded) {
568
+        if ( ! $this->serializationVisitorsAdded) {
569 569
             $this->addDefaultSerializationVisitors();
570 570
         }
571 571
 
572
-        if (!$this->deserializationVisitorsAdded) {
572
+        if ( ! $this->deserializationVisitorsAdded) {
573 573
             $this->addDefaultDeserializationVisitors();
574 574
         }
575 575
 
@@ -635,12 +635,12 @@  discard block
 block discarded – undo
635 635
     private function decorateAnnotationReader(Reader $annotationReader): Reader
636 636
     {
637 637
         if (null !== $this->cacheDir) {
638
-            $this->createDir($this->cacheDir . '/annotations');
638
+            $this->createDir($this->cacheDir.'/annotations');
639 639
             if (class_exists(FilesystemAdapter::class)) {
640
-                $annotationsCache = new FilesystemAdapter('', 0, $this->cacheDir . '/annotations');
640
+                $annotationsCache = new FilesystemAdapter('', 0, $this->cacheDir.'/annotations');
641 641
                 $annotationReader = new PsrCachedReader($annotationReader, $annotationsCache, $this->debug);
642 642
             } else {
643
-                $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations');
643
+                $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations');
644 644
                 $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug);
645 645
             }
646 646
         }
Please login to merge, or discard this patch.
src/Metadata/Driver/DocBlockDriver/DocBlockTypeResolver.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function getPropertyDocblockTypeHint(\ReflectionProperty $reflectionProperty): ?string
58 58
     {
59
-        if (!$reflectionProperty->getDocComment()) {
59
+        if ( ! $reflectionProperty->getDocComment()) {
60 60
             return null;
61 61
         }
62 62
 
@@ -91,25 +91,25 @@  discard block
 block discarded – undo
91 91
         if ($type instanceof ArrayTypeNode) {
92 92
             $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflectionProperty);
93 93
 
94
-            return 'array<' . $resolvedType . '>';
94
+            return 'array<'.$resolvedType.'>';
95 95
         }
96 96
 
97 97
         // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product>
98 98
         if ($type instanceof GenericTypeNode) {
99 99
             if ($this->isSimpleType($type->type, 'array')) {
100
-                $resolvedTypes = array_map(function (TypeNode $node) use ($reflectionProperty) {
100
+                $resolvedTypes = array_map(function(TypeNode $node) use ($reflectionProperty) {
101 101
                     return $this->resolveTypeFromTypeNode($node, $reflectionProperty);
102 102
                 }, $type->genericTypes);
103 103
 
104
-                return 'array<' . implode(',', $resolvedTypes) . '>';
104
+                return 'array<'.implode(',', $resolvedTypes).'>';
105 105
             }
106 106
 
107 107
             if ($this->isSimpleType($type->type, 'list')) {
108
-                $resolvedTypes = array_map(function (TypeNode $node) use ($reflectionProperty) {
108
+                $resolvedTypes = array_map(function(TypeNode $node) use ($reflectionProperty) {
109 109
                     return $this->resolveTypeFromTypeNode($node, $reflectionProperty);
110 110
                 }, $type->genericTypes);
111 111
 
112
-                return 'array<int, ' . implode(',', $resolvedTypes) . '>';
112
+                return 'array<int, '.implode(',', $resolvedTypes).'>';
113 113
             }
114 114
 
115 115
             throw new \InvalidArgumentException(sprintf("Can't use non-array generic type %s for collection in %s:%s", (string) $type->type, $reflectionProperty->getDeclaringClass()->getName(), $reflectionProperty->getName()));
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             return [];
133 133
         }
134 134
 
135
-        return array_merge(...array_map(static function (VarTagValueNode $node) {
135
+        return array_merge(...array_map(static function(VarTagValueNode $node) {
136 136
             if ($node->type instanceof UnionTypeNode) {
137 137
                 return $node->type->types;
138 138
             }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function filterNullFromTypes(array $types): array
152 152
     {
153
-        return array_values(array_filter(array_map(function (TypeNode $node) {
153
+        return array_values(array_filter(array_map(function(TypeNode $node) {
154 154
             return $this->isNullType($node) ? null : $node;
155 155
         }, $types)));
156 156
     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     private function resolveTypeFromTypeNode(TypeNode $typeNode, \ReflectionProperty $reflectionProperty): string
195 195
     {
196
-        if (!($typeNode instanceof IdentifierTypeNode)) {
196
+        if ( ! ($typeNode instanceof IdentifierTypeNode)) {
197 197
             throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflectionProperty->getDeclaringClass()->getName(), $reflectionProperty->getName()));
198 198
         }
199 199
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             return $typeHint;
207 207
         }
208 208
 
209
-        $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint;
209
+        $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint;
210 210
         if ($this->isClassOrInterface($expandedClassName)) {
211 211
             return $expandedClassName;
212 212
         }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
     private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool
234 234
     {
235
-        $typeHintToSearchFor = '\\' . $typeHintToSearchFor;
235
+        $typeHintToSearchFor = '\\'.$typeHintToSearchFor;
236 236
 
237 237
         return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor;
238 238
     }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements);
254 254
         for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) {
255 255
             foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) {
256
-                $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement);
256
+                $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement);
257 257
             }
258 258
         }
259 259
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
     private function resolveType(string $typeHint, \ReflectionProperty $reflectionProperty): string
288 288
     {
289
-        if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) {
289
+        if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) {
290 290
             $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflectionProperty), $reflectionProperty);
291 291
         }
292 292
 
Please login to merge, or discard this patch.
src/XmlSerializationVisitor.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     public function createRoot(?ClassMetadata $metadata = null, ?string $rootName = null, ?string $rootNamespace = null, ?string $rootPrefix = null): \DOMElement
106 106
     {
107
-        if (null !== $metadata && !empty($metadata->xmlRootName)) {
107
+        if (null !== $metadata && ! empty($metadata->xmlRootName)) {
108 108
             $rootPrefix = $metadata->xmlRootPrefix;
109 109
             $rootName = $metadata->xmlRootName;
110 110
             $rootNamespace = $metadata->xmlRootNamespace ?: $this->getClassDefaultNamespace($metadata);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         $document = $this->getDocument();
118 118
         if ($rootNamespace) {
119
-            $rootNode = $document->createElementNS($rootNamespace, (null !== $rootPrefix ? $rootPrefix . ':' : '') . $rootName);
119
+            $rootNode = $document->createElementNS($rootNamespace, (null !== $rootPrefix ? $rootPrefix.':' : '').$rootName);
120 120
         } else {
121 121
             $rootNode = $document->createElement($rootName);
122 122
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $decimalsNumbers = $type['params'][2] ?? null;
191 191
         if ($decimalsNumbers === null) {
192 192
             $parts = explode('.', (string) $dataResult);
193
-            if (count($parts) < 2 || !$parts[1]) {
193
+            if (count($parts) < 2 || ! $parts[1]) {
194 194
                 $decimalsNumbers = 1;
195 195
             }
196 196
         }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             $node = $this->navigator->accept($v, $metadata->type);
265 265
             $this->revertCurrentMetadata();
266 266
 
267
-            if (!$node instanceof \DOMCharacterData) {
267
+            if ( ! $node instanceof \DOMCharacterData) {
268 268
                 throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v)));
269 269
             }
270 270
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
         if (
277 277
             ($metadata->xmlValue && $this->currentNode->childNodes->length > 0)
278
-            || (!$metadata->xmlValue && $this->hasValue)
278
+            || ( ! $metadata->xmlValue && $this->hasValue)
279 279
         ) {
280 280
             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));
281 281
         }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             $node = $this->navigator->accept($v, $metadata->type);
288 288
             $this->revertCurrentMetadata();
289 289
 
290
-            if (!$node instanceof \DOMCharacterData) {
290
+            if ( ! $node instanceof \DOMCharacterData) {
291 291
                 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)));
292 292
             }
293 293
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         }
298 298
 
299 299
         if ($metadata->xmlAttributeMap) {
300
-            if (!\is_array($v)) {
300
+            if ( ! \is_array($v)) {
301 301
                 throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', \gettype($v)));
302 302
             }
303 303
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 $node = $this->navigator->accept($value, null);
307 307
                 $this->revertCurrentMetadata();
308 308
 
309
-                if (!$node instanceof \DOMCharacterData) {
309
+                if ( ! $node instanceof \DOMCharacterData) {
310 310
                     throw new RuntimeException(sprintf('Unsupported value for a XML attribute map value. Expected character data, but got %s.', json_encode($v)));
311 311
                 }
312 312
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             return;
317 317
         }
318 318
 
319
-        if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) {
319
+        if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) {
320 320
             $namespace = null !== $metadata->xmlNamespace
321 321
                 ? $metadata->xmlNamespace
322 322
                 : $this->getClassDefaultNamespace($this->objectMetadataStack->top());
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
     private function isSkippableEmptyObject(?\DOMElement $node, PropertyMetadata $metadata): bool
363 363
     {
364
-        return null === $node && !$metadata->xmlCollection && $metadata->skipWhenEmpty;
364
+        return null === $node && ! $metadata->xmlCollection && $metadata->skipWhenEmpty;
365 365
     }
366 366
 
367 367
     private function isSkippableCollection(PropertyMetadata $metadata): bool
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     private function isElementEmpty(\DOMElement $element): bool
373 373
     {
374
-        return !$element->hasChildNodes() && !$element->hasAttributes();
374
+        return ! $element->hasChildNodes() && ! $element->hasAttributes();
375 375
     }
376 376
 
377 377
     public function endVisitingObject(ClassMetadata $metadata, object $data, array $type): void
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
         foreach ($metadata->xmlNamespaces as $prefix => $uri) {
476 476
             $attribute = 'xmlns';
477 477
             if ('' !== $prefix) {
478
-                $attribute .= ':' . $prefix;
478
+                $attribute .= ':'.$prefix;
479 479
             } elseif ($element->namespaceURI === $uri) {
480 480
                 continue;
481 481
             }
@@ -505,21 +505,21 @@  discard block
 block discarded – undo
505 505
             return $this->document->createElementNS($namespace, $tagName);
506 506
         }
507 507
 
508
-        if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) {
509
-            $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
508
+        if ( ! ($prefix = $this->currentNode->lookupPrefix($namespace)) && ! ($prefix = $this->document->lookupPrefix($namespace))) {
509
+            $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
510 510
         }
511 511
 
512
-        return $this->document->createElementNS($namespace, $prefix . ':' . $tagName);
512
+        return $this->document->createElementNS($namespace, $prefix.':'.$tagName);
513 513
     }
514 514
 
515 515
     private function setAttributeOnNode(\DOMElement $node, string $name, string $value, ?string $namespace = null): void
516 516
     {
517 517
         if (null !== $namespace) {
518
-            if (!$prefix = $node->lookupPrefix($namespace)) {
519
-                $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
518
+            if ( ! $prefix = $node->lookupPrefix($namespace)) {
519
+                $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
520 520
             }
521 521
 
522
-            $node->setAttributeNS($namespace, $prefix . ':' . $name, $value);
522
+            $node->setAttributeNS($namespace, $prefix.':'.$name, $value);
523 523
         } else {
524 524
             $node->setAttribute($name, $value);
525 525
         }
Please login to merge, or discard this patch.