Passed
Pull Request — master (#1266)
by Alexey
13:51
created
src/Metadata/Driver/AbstractDoctrineTypeDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         \assert($classMetadata instanceof ClassMetadata);
84 84
 
85 85
         // Abort if the given class is not a mapped entity
86
-        if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) {
86
+        if ( ! $doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) {
87 87
             return $classMetadata;
88 88
         }
89 89
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
     protected function tryLoadingDoctrineMetadata(string $className): ?DoctrineClassMetadata
131 131
     {
132
-        if (!$manager = $this->registry->getManagerForClass($className)) {
132
+        if ( ! $manager = $this->registry->getManagerForClass($className)) {
133 133
             return null;
134 134
         }
135 135
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
     protected function normalizeFieldType(string $type): ?string
144 144
     {
145
-        if (!isset($this->fieldMapping[$type])) {
145
+        if ( ! isset($this->fieldMapping[$type])) {
146 146
             return null;
147 147
         }
148 148
 
Please login to merge, or discard this patch.
src/Metadata/Driver/AnnotationDriver.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     public function loadMetadataForClass(\ReflectionClass $class): ?BaseClassMetadata
78 78
     {
79 79
         $classMetadata = new ClassMetadata($name = $class->name);
80
-        $fileResource =  $class->getFilename();
80
+        $fileResource = $class->getFilename();
81 81
         if (false !== $fileResource) {
82 82
             $classMetadata->fileResources[] = $fileResource;
83 83
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             }
158 158
         }
159 159
 
160
-        if (!$excludeAll) {
160
+        if ( ! $excludeAll) {
161 161
             foreach ($class->getProperties() as $property) {
162 162
                 if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
163 163
                     continue;
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                     } elseif ($annot instanceof Expose) {
190 190
                         $isExpose = true;
191 191
                         if (null !== $annot->if) {
192
-                            $propertyMetadata->excludeIf = $this->parseExpression('!(' . $annot->if . ')');
192
+                            $propertyMetadata->excludeIf = $this->parseExpression('!('.$annot->if.')');
193 193
                         }
194 194
                     } elseif ($annot instanceof Exclude) {
195 195
                         if (null !== $annot->if) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                                 throw new InvalidMetadataException(sprintf(
239 239
                                     'Invalid group name "%s" on "%s", did you mean to create multiple groups?',
240 240
                                     implode(', ', $propertyMetadata->groups),
241
-                                    $propertyMetadata->class . '->' . $propertyMetadata->name
241
+                                    $propertyMetadata->class.'->'.$propertyMetadata->name
242 242
                                 ));
243 243
                             }
244 244
                         }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                     }
261 261
                 }
262 262
 
263
-                if (!$propertyMetadata->serializedName) {
263
+                if ( ! $propertyMetadata->serializedName) {
264 264
                     $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata);
265 265
                 }
266 266
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                 }
272 272
 
273 273
                 if (
274
-                    (ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude)
274
+                    (ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
275 275
                     || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)
276 276
                 ) {
277 277
                     $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]);
Please login to merge, or discard this patch.
src/SerializationContext.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function startVisiting($object): void
66 66
     {
67
-        if (!\is_object($object)) {
67
+        if ( ! \is_object($object)) {
68 68
             return;
69 69
         }
70 70
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function stopVisiting($object): void
79 79
     {
80
-        if (!\is_object($object)) {
80
+        if ( ! \is_object($object)) {
81 81
             return;
82 82
         }
83 83
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function isVisiting($object): bool
96 96
     {
97
-        if (!\is_object($object)) {
97
+        if ( ! \is_object($object)) {
98 98
             return false;
99 99
         }
100 100
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $path[] = \get_class($obj);
109 109
         }
110 110
 
111
-        if (!$path) {
111
+        if ( ! $path) {
112 112
             return null;
113 113
         }
114 114
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     public function getObject(): ?object
129 129
     {
130
-        return !$this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
130
+        return ! $this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
131 131
     }
132 132
 
133 133
     public function getVisitingStack(): \SplStack
Please login to merge, or discard this patch.
src/XmlDeserializationVisitor.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         if (false !== stripos($data, '<!doctype')) {
83 83
             $internalSubset = $this->getDomDocumentTypeEntitySubset($data);
84
-            if (!in_array($internalSubset, $this->doctypeWhitelist, true)) {
84
+            if ( ! in_array($internalSubset, $this->doctypeWhitelist, true)) {
85 85
                 throw new InvalidArgumentException(sprintf(
86 86
                     'The document type "%s" is not allowed. If it is safe, you may add it to the whitelist configuration.',
87 87
                     $internalSubset
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $nodes = $data->xpath($entryName);
203 203
         }
204 204
 
205
-        if (!\count($nodes)) {
205
+        if ( ! \count($nodes)) {
206 206
             return [];
207 207
         }
208 208
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 $nodes = $data->children($namespace)->$entryName;
231 231
                 foreach ($nodes as $v) {
232 232
                     $attrs = $v->attributes();
233
-                    if (!isset($attrs[$this->currentMetadata->xmlKeyAttribute])) {
233
+                    if ( ! isset($attrs[$this->currentMetadata->xmlKeyAttribute])) {
234 234
                         throw new RuntimeException(sprintf('The key attribute "%s" must be set for each entry of the map.', $this->currentMetadata->xmlKeyAttribute));
235 235
                     }
236 236
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 return (string) $data->attributes($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
261 261
 
262 262
             // Check XML element with namespace for discriminatorFieldName
263
-            case !$metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
263
+            case ! $metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
264 264
                 return (string) $data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
265 265
 
266 266
             // Check XML element for discriminatorFieldName
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         $name = $metadata->serializedName;
291 291
 
292 292
         if (true === $metadata->inline) {
293
-            if (!$metadata->type) {
293
+            if ( ! $metadata->type) {
294 294
                 throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
295 295
             }
296 296
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
         if ($metadata->xmlAttribute) {
301 301
             $attributes = $data->attributes($metadata->xmlNamespace);
302 302
             if (isset($attributes[$name])) {
303
-                if (!$metadata->type) {
303
+                if ( ! $metadata->type) {
304 304
                     throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
305 305
                 }
306 306
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         }
312 312
 
313 313
         if ($metadata->xmlValue) {
314
-            if (!$metadata->type) {
314
+            if ( ! $metadata->type) {
315 315
                 throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
316 316
             }
317 317
 
@@ -320,12 +320,12 @@  discard block
 block discarded – undo
320 320
 
321 321
         if ($metadata->xmlCollection) {
322 322
             $enclosingElem = $data;
323
-            if (!$metadata->xmlCollectionInline) {
323
+            if ( ! $metadata->xmlCollectionInline) {
324 324
                 $enclosingElem = $data->children($metadata->xmlNamespace)->$name;
325 325
             }
326 326
 
327 327
             $this->setCurrentMetadata($metadata);
328
-            if (!$metadata->type) {
328
+            if ( ! $metadata->type) {
329 329
                 throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
330 330
             }
331 331
 
@@ -337,13 +337,13 @@  discard block
 block discarded – undo
337 337
 
338 338
         if ($metadata->xmlNamespace) {
339 339
             $node = $data->children($metadata->xmlNamespace)->$name;
340
-            if (!$node->count()) {
340
+            if ( ! $node->count()) {
341 341
                 throw new NotAcceptableException();
342 342
             }
343 343
         } elseif ('' === $metadata->xmlNamespace) {
344 344
             // See #1087 - element must be like: <element xmlns="" /> - https://www.w3.org/TR/REC-xml-names/#iri-use
345 345
             // Use of an empty string in a namespace declaration turns it into an "undeclaration".
346
-            $nodes = $data->xpath('./' . $name);
346
+            $nodes = $data->xpath('./'.$name);
347 347
             if (empty($nodes)) {
348 348
                 throw new NotAcceptableException();
349 349
             }
@@ -354,9 +354,9 @@  discard block
 block discarded – undo
354 354
             if (isset($namespaces[''])) {
355 355
                 $prefix = uniqid('ns-');
356 356
                 $data->registerXPathNamespace($prefix, $namespaces['']);
357
-                $nodes = $data->xpath('./' . $prefix . ':' . $name);
357
+                $nodes = $data->xpath('./'.$prefix.':'.$name);
358 358
             } else {
359
-                $nodes = $data->xpath('./' . $name);
359
+                $nodes = $data->xpath('./'.$name);
360 360
             }
361 361
 
362 362
             if (empty($nodes)) {
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             $this->setCurrentMetadata($metadata);
371 371
         }
372 372
 
373
-        if (!$metadata->type) {
373
+        if ( ! $metadata->type) {
374 374
             throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
375 375
         }
376 376
 
Please login to merge, or discard this patch.
src/Exclusion/GroupsExclusionStrategy.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
         if ($this->nestedGroups) {
55 55
             $groups = $this->getGroupsFor($navigatorContext);
56 56
 
57
-            if (!$property->groups) {
58
-                return !in_array(self::DEFAULT_GROUP, $groups);
57
+            if ( ! $property->groups) {
58
+                return ! in_array(self::DEFAULT_GROUP, $groups);
59 59
             }
60 60
 
61 61
             return $this->shouldSkipUsingGroups($property, $groups);
62 62
         } else {
63
-            if (!$property->groups) {
64
-                return !isset($this->groups[self::DEFAULT_GROUP]);
63
+            if ( ! $property->groups) {
64
+                return ! isset($this->groups[self::DEFAULT_GROUP]);
65 65
             }
66 66
 
67 67
             foreach ($property->groups as $group) {
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 
88 88
     public function getGroupsFor(Context $navigatorContext): array
89 89
     {
90
-        if (!$this->nestedGroups) {
90
+        if ( ! $this->nestedGroups) {
91 91
             return array_keys($this->groups);
92 92
         }
93 93
 
94 94
         $paths = $navigatorContext->getCurrentPath();
95 95
         $groups = $this->groups;
96 96
         foreach ($paths as $index => $path) {
97
-            if (!array_key_exists($path, $groups)) {
97
+            if ( ! array_key_exists($path, $groups)) {
98 98
                 if ($index > 0) {
99 99
                     $groups = [self::DEFAULT_GROUP];
100 100
                 }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             }
104 104
 
105 105
             $groups = $groups[$path];
106
-            if (!array_filter($groups, 'is_string')) {
106
+            if ( ! array_filter($groups, 'is_string')) {
107 107
                 $groups += [self::DEFAULT_GROUP];
108 108
             }
109 109
         }
Please login to merge, or discard this patch.
src/SerializerBuilder.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
     private function getAccessorStrategy(): AccessorStrategyInterface
203 203
     {
204
-        if (!$this->accessorStrategy) {
204
+        if ( ! $this->accessorStrategy) {
205 205
             $this->accessorStrategy = new DefaultAccessorStrategy($this->expressionEvaluator);
206 206
         }
207 207
 
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
 
239 239
     public function setCacheDir(string $dir): self
240 240
     {
241
-        if (!is_dir($dir)) {
241
+        if ( ! is_dir($dir)) {
242 242
             $this->createDir($dir);
243 243
         }
244 244
 
245
-        if (!is_writable($dir)) {
245
+        if ( ! is_writable($dir)) {
246 246
             throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
247 247
         }
248 248
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
     public function setMetadataDirs(array $namespacePrefixToDirMap): self
365 365
     {
366 366
         foreach ($namespacePrefixToDirMap as $dir) {
367
-            if (!is_dir($dir)) {
367
+            if ( ! is_dir($dir)) {
368 368
                 throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
369 369
             }
370 370
         }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
      */
403 403
     public function addMetadataDir(string $dir, string $namespacePrefix = ''): self
404 404
     {
405
-        if (!is_dir($dir)) {
405
+        if ( ! is_dir($dir)) {
406 406
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
407 407
         }
408 408
 
@@ -441,11 +441,11 @@  discard block
 block discarded – undo
441 441
      */
442 442
     public function replaceMetadataDir(string $dir, string $namespacePrefix = ''): self
443 443
     {
444
-        if (!is_dir($dir)) {
444
+        if ( ! is_dir($dir)) {
445 445
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
446 446
         }
447 447
 
448
-        if (!isset($this->metadataDirs[$namespacePrefix])) {
448
+        if ( ! isset($this->metadataDirs[$namespacePrefix])) {
449 449
             throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix));
450 450
         }
451 451
 
@@ -511,8 +511,8 @@  discard block
 block discarded – undo
511 511
             $annotationReader = new AnnotationReader();
512 512
 
513 513
             if (null !== $this->cacheDir) {
514
-                $this->createDir($this->cacheDir . '/annotations');
515
-                $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations');
514
+                $this->createDir($this->cacheDir.'/annotations');
515
+                $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations');
516 516
                 $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug);
517 517
             }
518 518
         }
@@ -534,19 +534,19 @@  discard block
 block discarded – undo
534 534
         if (null !== $this->metadataCache) {
535 535
             $metadataFactory->setCache($this->metadataCache);
536 536
         } elseif (null !== $this->cacheDir) {
537
-            $this->createDir($this->cacheDir . '/metadata');
538
-            $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata'));
537
+            $this->createDir($this->cacheDir.'/metadata');
538
+            $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata'));
539 539
         }
540 540
 
541
-        if (!$this->handlersConfigured) {
541
+        if ( ! $this->handlersConfigured) {
542 542
             $this->addDefaultHandlers();
543 543
         }
544 544
 
545
-        if (!$this->listenersConfigured) {
545
+        if ( ! $this->listenersConfigured) {
546 546
             $this->addDefaultListeners();
547 547
         }
548 548
 
549
-        if (!$this->visitorsAdded) {
549
+        if ( ! $this->visitorsAdded) {
550 550
             $this->addDefaultSerializationVisitors();
551 551
             $this->addDefaultDeserializationVisitors();
552 552
         }
Please login to merge, or discard this patch.
src/Naming/CamelCaseNamingStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
     public function translateName(PropertyMetadata $property): string
33 33
     {
34
-        $name = preg_replace('/[A-Z]+/', $this->separator . '\\0', $property->name);
34
+        $name = preg_replace('/[A-Z]+/', $this->separator.'\\0', $property->name);
35 35
 
36 36
         if ($this->lowerCase) {
37 37
             return strtolower($name);
Please login to merge, or discard this patch.
src/XmlSerializationVisitor.php 1 patch
Spacing   +17 added lines, -17 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
         }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
             $node = $this->navigator->accept($v, $metadata->type);
246 246
             $this->revertCurrentMetadata();
247 247
 
248
-            if (!$node instanceof \DOMCharacterData) {
248
+            if ( ! $node instanceof \DOMCharacterData) {
249 249
                 throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v)));
250 250
             }
251 251
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         if (
258 258
             ($metadata->xmlValue && $this->currentNode->childNodes->length > 0)
259
-            || (!$metadata->xmlValue && $this->hasValue)
259
+            || ( ! $metadata->xmlValue && $this->hasValue)
260 260
         ) {
261 261
             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));
262 262
         }
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             $node = $this->navigator->accept($v, $metadata->type);
269 269
             $this->revertCurrentMetadata();
270 270
 
271
-            if (!$node instanceof \DOMCharacterData) {
271
+            if ( ! $node instanceof \DOMCharacterData) {
272 272
                 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)));
273 273
             }
274 274
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         }
279 279
 
280 280
         if ($metadata->xmlAttributeMap) {
281
-            if (!\is_array($v)) {
281
+            if ( ! \is_array($v)) {
282 282
                 throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', \gettype($v)));
283 283
             }
284 284
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 $node = $this->navigator->accept($value, null);
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 a XML attribute map value. Expected character data, but got %s.', json_encode($v)));
292 292
                 }
293 293
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             return;
298 298
         }
299 299
 
300
-        if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) {
300
+        if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) {
301 301
             $namespace = null !== $metadata->xmlNamespace
302 302
                 ? $metadata->xmlNamespace
303 303
                 : $this->getClassDefaultNamespace($this->objectMetadataStack->top());
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 
343 343
     private function isSkippableEmptyObject(?\DOMElement $node, PropertyMetadata $metadata): bool
344 344
     {
345
-        return null === $node && !$metadata->xmlCollection && $metadata->skipWhenEmpty;
345
+        return null === $node && ! $metadata->xmlCollection && $metadata->skipWhenEmpty;
346 346
     }
347 347
 
348 348
     private function isSkippableCollection(PropertyMetadata $metadata): bool
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
     private function isElementEmpty(\DOMElement $element): bool
354 354
     {
355
-        return !$element->hasChildNodes() && !$element->hasAttributes();
355
+        return ! $element->hasChildNodes() && ! $element->hasAttributes();
356 356
     }
357 357
 
358 358
     public function endVisitingObject(ClassMetadata $metadata, object $data, array $type): void
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
         foreach ($metadata->xmlNamespaces as $prefix => $uri) {
461 461
             $attribute = 'xmlns';
462 462
             if ('' !== $prefix) {
463
-                $attribute .= ':' . $prefix;
463
+                $attribute .= ':'.$prefix;
464 464
             } elseif ($element->namespaceURI === $uri) {
465 465
                 continue;
466 466
             }
@@ -490,21 +490,21 @@  discard block
 block discarded – undo
490 490
             return $this->document->createElementNS($namespace, $tagName);
491 491
         }
492 492
 
493
-        if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) {
494
-            $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
493
+        if ( ! ($prefix = $this->currentNode->lookupPrefix($namespace)) && ! ($prefix = $this->document->lookupPrefix($namespace))) {
494
+            $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
495 495
         }
496 496
 
497
-        return $this->document->createElementNS($namespace, $prefix . ':' . $tagName);
497
+        return $this->document->createElementNS($namespace, $prefix.':'.$tagName);
498 498
     }
499 499
 
500 500
     private function setAttributeOnNode(\DOMElement $node, string $name, string $value, ?string $namespace = null): void
501 501
     {
502 502
         if (null !== $namespace) {
503
-            if (!$prefix = $node->lookupPrefix($namespace)) {
504
-                $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
503
+            if ( ! $prefix = $node->lookupPrefix($namespace)) {
504
+                $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
505 505
             }
506 506
 
507
-            $node->setAttributeNS($namespace, $prefix . ':' . $name, $value);
507
+            $node->setAttributeNS($namespace, $prefix.':'.$name, $value);
508 508
         } else {
509 509
             $node->setAttribute($name, $value);
510 510
         }
Please login to merge, or discard this patch.
src/Accessor/DefaultAccessorStrategy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         $accessor = $this->readAccessors[$metadata->class] ?? null;
87 87
         if (null === $accessor) {
88
-            $accessor = \Closure::bind(static function ($o, $name) {
88
+            $accessor = \Closure::bind(static function($o, $name) {
89 89
                 return $o->$name;
90 90
             }, null, $metadata->class);
91 91
             $this->readAccessors[$metadata->class] = $accessor;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
         $accessor = $this->writeAccessors[$metadata->class] ?? null;
126 126
         if (null === $accessor) {
127
-            $accessor = \Closure::bind(static function ($o, $name, $value): void {
127
+            $accessor = \Closure::bind(static function($o, $name, $value): void {
128 128
                 $o->$name = $value;
129 129
             }, null, $metadata->class);
130 130
             $this->writeAccessors[$metadata->class] = $accessor;
Please login to merge, or discard this patch.