Passed
Pull Request — master (#1606)
by Ivan
02:54
created
src/Builder/CallbackDriverFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     public function createDriver(array $metadataDirs, ?Reader $reader = null): DriverInterface
28 28
     {
29 29
         $driver = \call_user_func($this->callback, $metadataDirs, $reader);
30
-        if (!$driver instanceof DriverInterface) {
30
+        if ( ! $driver instanceof DriverInterface) {
31 31
             throw new LogicException('The callback must return an instance of DriverInterface.');
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Context.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $this->addExclusionStrategy(new VersionExclusionStrategy($this->attributes['version']));
79 79
         }
80 80
 
81
-        if (!empty($this->attributes['max_depth_checks'])) {
81
+        if ( ! empty($this->attributes['max_depth_checks'])) {
82 82
             $this->addExclusionStrategy(new DepthExclusionStrategy());
83 83
         }
84 84
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
     final protected function assertMutable(): void
135 135
     {
136
-        if (!$this->initialized) {
136
+        if ( ! $this->initialized) {
137 137
             return;
138 138
         }
139 139
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         $metadata = $this->metadataStack->pop();
224 224
 
225
-        if (!$metadata instanceof PropertyMetadata) {
225
+        if ( ! $metadata instanceof PropertyMetadata) {
226 226
             throw new RuntimeException('Context metadataStack not working well');
227 227
         }
228 228
     }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
     {
232 232
         $metadata = $this->metadataStack->pop();
233 233
 
234
-        if (!$metadata instanceof ClassMetadata) {
234
+        if ( ! $metadata instanceof ClassMetadata) {
235 235
             throw new RuntimeException('Context metadataStack not working well');
236 236
         }
237 237
     }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
     public function getCurrentPath(): array
245 245
     {
246
-        if (!$this->metadataStack) {
246
+        if ( ! $this->metadataStack) {
247 247
             return [];
248 248
         }
249 249
 
Please login to merge, or discard this patch.
src/Metadata/Driver/TypedPropertiesDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     private function reorderTypes(array $types): array
61 61
     {
62
-        uasort($types, static function ($a, $b) {
62
+        uasort($types, static function($a, $b) {
63 63
             $order = ['null' => 0, 'true' => 1, 'false' => 2, 'bool' => 3, 'int' => 4, 'float' => 5, 'array' => 6, 'string' => 7];
64 64
 
65 65
             return ($order[$a['name']] ?? 8) <=> ($order[$b['name']] ?? 8);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     private function shouldTypeHint(?ReflectionType $reflectionType): bool
161 161
     {
162
-        if (!$reflectionType instanceof ReflectionNamedType) {
162
+        if ( ! $reflectionType instanceof ReflectionNamedType) {
163 163
             return false;
164 164
         }
165 165
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     private function shouldTypeHintUnion(?ReflectionType $reflectionType)
178 178
     {
179
-        if (!$reflectionType instanceof \ReflectionUnionType) {
179
+        if ( ! $reflectionType instanceof \ReflectionUnionType) {
180 180
             return false;
181 181
         }
182 182
 
Please login to merge, or discard this patch.
src/Handler/UnionHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
             case 'bool':
146 146
             case 'boolean':
147
-                return !is_array($data) && (string) (bool) $data === (string) $data;
147
+                return ! is_array($data) && (string) (bool) $data === (string) $data;
148 148
 
149 149
             case 'true':
150 150
                 return true === $data;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
                 return false === $data;
154 154
 
155 155
             case 'string':
156
-                return !is_array($data) && !is_object($data);
156
+                return ! is_array($data) && ! is_object($data);
157 157
         }
158 158
 
159 159
         return false;
Please login to merge, or discard this patch.
src/Handler/ConstraintViolationHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
                     'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION,
33 33
                     'type' => $type,
34 34
                     'format' => $format,
35
-                    'method' => $method . 'To' . $format,
35
+                    'method' => $method.'To'.$format,
36 36
                 ];
37 37
             }
38 38
         }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     public function serializeListToXml(XmlSerializationVisitor $visitor, ConstraintViolationList $list): void
44 44
     {
45 45
         $currentNode = $visitor->getCurrentNode();
46
-        if (!$currentNode) {
46
+        if ( ! $currentNode) {
47 47
             $visitor->createRoot();
48 48
         }
49 49
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $violationNode = $visitor->getDocument()->createElement('violation');
68 68
 
69 69
         $parent = $visitor->getCurrentNode();
70
-        if (!$parent) {
70
+        if ( ! $parent) {
71 71
             $visitor->setCurrentAndRootNode($violationNode);
72 72
         } else {
73 73
             $parent->appendChild($violationNode);
Please login to merge, or discard this patch.
src/Metadata/PropertyMetadata.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -176,22 +176,22 @@  discard block
 block discarded – undo
176 176
             $class = $this->getReflection()->getDeclaringClass();
177 177
 
178 178
             if (empty($getter)) {
179
-                if ($class->hasMethod('get' . $this->name) && $class->getMethod('get' . $this->name)->isPublic()) {
180
-                    $getter = 'get' . $this->name;
181
-                } elseif ($class->hasMethod('is' . $this->name) && $class->getMethod('is' . $this->name)->isPublic()) {
182
-                    $getter = 'is' . $this->name;
183
-                } elseif ($class->hasMethod('has' . $this->name) && $class->getMethod('has' . $this->name)->isPublic()) {
184
-                    $getter = 'has' . $this->name;
179
+                if ($class->hasMethod('get'.$this->name) && $class->getMethod('get'.$this->name)->isPublic()) {
180
+                    $getter = 'get'.$this->name;
181
+                } elseif ($class->hasMethod('is'.$this->name) && $class->getMethod('is'.$this->name)->isPublic()) {
182
+                    $getter = 'is'.$this->name;
183
+                } elseif ($class->hasMethod('has'.$this->name) && $class->getMethod('has'.$this->name)->isPublic()) {
184
+                    $getter = 'has'.$this->name;
185 185
                 } else {
186
-                    throw new InvalidMetadataException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get' . ucfirst($this->name), 'is' . ucfirst($this->name), 'has' . ucfirst($this->name), $this->class, $this->name));
186
+                    throw new InvalidMetadataException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get'.ucfirst($this->name), 'is'.ucfirst($this->name), 'has'.ucfirst($this->name), $this->class, $this->name));
187 187
                 }
188 188
             }
189 189
 
190
-            if (empty($setter) && !$this->readOnly) {
191
-                if ($class->hasMethod('set' . $this->name) && $class->getMethod('set' . $this->name)->isPublic()) {
192
-                    $setter = 'set' . $this->name;
190
+            if (empty($setter) && ! $this->readOnly) {
191
+                if ($class->hasMethod('set'.$this->name) && $class->getMethod('set'.$this->name)->isPublic()) {
192
+                    $setter = 'set'.$this->name;
193 193
                 } else {
194
-                    throw new InvalidMetadataException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set' . ucfirst($this->name), $this->class, $this->name));
194
+                    throw new InvalidMetadataException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set'.ucfirst($this->name), $this->class, $this->name));
195 195
                 }
196 196
             }
197 197
         }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         return is_array($type)
217 217
             && 'array' === $type['name']
218 218
             && isset($type['params'][0])
219
-            && !isset($type['params'][1]);
219
+            && ! isset($type['params'][1]);
220 220
     }
221 221
 
222 222
     /**
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
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if ($type instanceof ArrayTypeNode) {
127 127
             $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflector);
128 128
 
129
-            return 'array<' . $resolvedType . '>';
129
+            return 'array<'.$resolvedType.'>';
130 130
         }
131 131
 
132 132
         // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product>
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
             if ($this->isSimpleType($type->type, 'array')) {
135 135
                 $resolvedTypes = array_map(fn (TypeNode $node) => $this->resolveTypeFromTypeNode($node, $reflector), $type->genericTypes);
136 136
 
137
-                return 'array<' . implode(',', $resolvedTypes) . '>';
137
+                return 'array<'.implode(',', $resolvedTypes).'>';
138 138
             }
139 139
 
140 140
             if ($this->isSimpleType($type->type, 'list')) {
141 141
                 $resolvedTypes = array_map(fn (TypeNode $node) => $this->resolveTypeFromTypeNode($node, $reflector), $type->genericTypes);
142 142
 
143
-                return 'list<' . implode(',', $resolvedTypes) . '>';
143
+                return 'list<'.implode(',', $resolvedTypes).'>';
144 144
             }
145 145
 
146 146
             throw new \InvalidArgumentException(sprintf("Can't use non-array generic type %s for collection in %s:%s", (string) $type->type, $reflector->getDeclaringClass()->getName(), $reflector->getName()));
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             return [];
164 164
         }
165 165
 
166
-        return array_merge(...array_map(static function ($node) {
166
+        return array_merge(...array_map(static function($node) {
167 167
             if ($node->type instanceof UnionTypeNode) {
168 168
                 return $node->type->types;
169 169
             }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     private function resolveTypeFromTypeNode(TypeNode $typeNode, $reflector): string
250 250
     {
251
-        if (!($typeNode instanceof IdentifierTypeNode)) {
251
+        if ( ! ($typeNode instanceof IdentifierTypeNode)) {
252 252
             throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflector->getDeclaringClass()->getName(), $reflector->getName()));
253 253
         }
254 254
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      */
261 261
     private function expandClassNameUsingUseStatements(string $typeHint, \ReflectionClass $declaringClass, $reflector): string
262 262
     {
263
-        $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint;
263
+        $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint;
264 264
         if ($this->isClassOrInterface($expandedClassName)) {
265 265
             return $expandedClassName;
266 266
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
     private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool
300 300
     {
301
-        $typeHintToSearchFor = '\\' . $typeHintToSearchFor;
301
+        $typeHintToSearchFor = '\\'.$typeHintToSearchFor;
302 302
 
303 303
         return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor;
304 304
     }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements);
320 320
         for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) {
321 321
             foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) {
322
-                $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement);
322
+                $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement);
323 323
             }
324 324
         }
325 325
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      */
359 359
     private function resolveType(string $typeHint, $reflector): string
360 360
     {
361
-        if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) {
361
+        if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) {
362 362
             $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflector), $reflector);
363 363
         }
364 364
 
@@ -376,15 +376,15 @@  discard block
 block discarded – undo
376 376
     private function resolveTypeFromDocblock($reflector): array
377 377
     {
378 378
         $docComment = $reflector->getDocComment();
379
-        if (!$docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) {
379
+        if ( ! $docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) {
380 380
             $constructor = $reflector->getDeclaringClass()->getConstructor();
381
-            if (!$constructor) {
381
+            if ( ! $constructor) {
382 382
                 return [];
383 383
             }
384 384
 
385 385
             $docComment = $constructor->getDocComment();
386 386
 
387
-            if (!$docComment) {
387
+            if ( ! $docComment) {
388 388
                 return [];
389 389
             }
390 390
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             return $this->flattenParamTagValueTypes($reflector->getName(), $phpDocNode->getParamTagValues());
395 395
         }
396 396
 
397
-        if (!$docComment) {
397
+        if ( ! $docComment) {
398 398
             return [];
399 399
         }
400 400
 
Please login to merge, or discard this patch.
src/Metadata/Driver/DoctrineTypeDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
     {
22 22
         assert($doctrineMetadata instanceof ORMClassMetadata || $doctrineMetadata instanceof ODMClassMetadata);
23 23
         if (
24
-            empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled
25
-            && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity()
24
+            empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled
25
+            && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity()
26 26
         ) {
27 27
             if ($doctrineMetadata->discriminatorColumn instanceof DiscriminatorColumnMapping) {
28 28
                 // Doctrine 3.1+
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
             // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy.
60 60
             // On serialization, this would lead to only the supertype being serialized, and properties of subtypes
61 61
             // being ignored.
62
-            if ($targetMetadata instanceof ODMClassMetadata && !$targetMetadata->isInheritanceTypeNone()) {
62
+            if ($targetMetadata instanceof ODMClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) {
63 63
                 return;
64 64
             }
65 65
 
66
-            if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) {
66
+            if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) {
67 67
                 $targetEntity = sprintf('ArrayCollection<%s>', $targetEntity);
68 68
             }
69 69
 
Please login to merge, or discard this patch.
src/XmlDeserializationVisitor.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         if (false !== stripos($data, '<!doctype')) {
87 87
             $internalSubset = $this->getDomDocumentTypeEntitySubset($data);
88
-            if (!in_array($internalSubset, $this->doctypeAllowList, true)) {
88
+            if ( ! in_array($internalSubset, $this->doctypeAllowList, true)) {
89 89
                 throw new InvalidArgumentException(sprintf(
90 90
                     'The document type "%s" is not allowed. If it is safe, you may add it to the allowlist configuration.',
91 91
                     $internalSubset,
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             $nodes = $data->xpath($entryName);
220 220
         }
221 221
 
222
-        if (null === $nodes || !\count($nodes)) {
222
+        if (null === $nodes || ! \count($nodes)) {
223 223
             return [];
224 224
         }
225 225
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                 $nodes = $data->children($namespace)->$entryName;
248 248
                 foreach ($nodes as $v) {
249 249
                     $attrs = $v->attributes();
250
-                    if (!isset($attrs[$this->currentMetadata->xmlKeyAttribute])) {
250
+                    if ( ! isset($attrs[$this->currentMetadata->xmlKeyAttribute])) {
251 251
                         throw new RuntimeException(sprintf('The key attribute "%s" must be set for each entry of the map.', $this->currentMetadata->xmlKeyAttribute));
252 252
                     }
253 253
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 return (string) $data->attributes($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
278 278
 
279 279
             // Check XML element with namespace for discriminatorFieldName
280
-            case !$metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
280
+            case ! $metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
281 281
                 return (string) $data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
282 282
 
283 283
             // Check XML element for discriminatorFieldName
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         $name = $metadata->serializedName;
308 308
 
309 309
         if (true === $metadata->inline) {
310
-            if (!$metadata->type) {
310
+            if ( ! $metadata->type) {
311 311
                 throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
312 312
             }
313 313
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         if ($metadata->xmlAttribute) {
318 318
             $attributes = $data->attributes($metadata->xmlNamespace);
319 319
             if (isset($attributes[$name])) {
320
-                if (!$metadata->type) {
320
+                if ( ! $metadata->type) {
321 321
                     throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
322 322
                 }
323 323
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             $attributes = $data->attributes($metadata->xmlNamespace);
333 333
 
334 334
             if (isset($attributes[$attributeName])) {
335
-                if (!$metadata->type) {
335
+                if ( ! $metadata->type) {
336 336
                     throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
337 337
                 }
338 338
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
             $childDataNode = null;
349 349
             if ('' === $metadata->xmlNamespace) {
350 350
                 // Element explicitly in NO namespace
351
-                $xpathQuery = "./*[local-name()='" . $elementName . "' and (namespace-uri()='' or not(namespace-uri()))]";
351
+                $xpathQuery = "./*[local-name()='".$elementName."' and (namespace-uri()='' or not(namespace-uri()))]";
352 352
                 $matchingNodes = $data->xpath($xpathQuery);
353
-                if (!empty($matchingNodes)) {
353
+                if ( ! empty($matchingNodes)) {
354 354
                     $childDataNode = $matchingNodes[0];
355 355
                 }
356 356
             } elseif ($metadata->xmlNamespace) {
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                 }
368 368
             }
369 369
 
370
-            if (!$childDataNode || !$childDataNode->getName()) {
370
+            if ( ! $childDataNode || ! $childDataNode->getName()) {
371 371
                 if (null === $metadata->xmlNamespace) {
372 372
                     $ns = '[default/none]';
373 373
                 } else {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             $attributes = $childDataNode->attributes($attributeTargetNs);
382 382
 
383 383
             if (isset($attributes[$attributeName])) {
384
-                if (!$metadata->type) {
384
+                if ( ! $metadata->type) {
385 385
                     throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
386 386
                 }
387 387
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
         }
393 393
 
394 394
         if ($metadata->xmlValue) {
395
-            if (!$metadata->type) {
395
+            if ( ! $metadata->type) {
396 396
                 throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
397 397
             }
398 398
 
@@ -401,12 +401,12 @@  discard block
 block discarded – undo
401 401
 
402 402
         if ($metadata->xmlCollection) {
403 403
             $enclosingElem = $data;
404
-            if (!$metadata->xmlCollectionInline) {
404
+            if ( ! $metadata->xmlCollectionInline) {
405 405
                 $enclosingElem = $data->children($metadata->xmlNamespace)->$name;
406 406
             }
407 407
 
408 408
             $this->setCurrentMetadata($metadata);
409
-            if (!$metadata->type) {
409
+            if ( ! $metadata->type) {
410 410
                 throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
411 411
             }
412 412
 
@@ -418,13 +418,13 @@  discard block
 block discarded – undo
418 418
 
419 419
         if ($metadata->xmlNamespace) {
420 420
             $node = $data->children($metadata->xmlNamespace)->$name;
421
-            if (!$node->count()) {
421
+            if ( ! $node->count()) {
422 422
                 throw new NotAcceptableException();
423 423
             }
424 424
         } elseif ('' === $metadata->xmlNamespace) {
425 425
             // See #1087 - element must be like: <element xmlns="" /> - https://www.w3.org/TR/REC-xml-names/#iri-use
426 426
             // Use of an empty string in a namespace declaration turns it into an "undeclaration".
427
-            $nodes = $data->xpath('./' . $name);
427
+            $nodes = $data->xpath('./'.$name);
428 428
             if (empty($nodes)) {
429 429
                 throw new NotAcceptableException();
430 430
             }
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
             if (isset($namespaces[''])) {
436 436
                 $prefix = uniqid('ns-');
437 437
                 $data->registerXPathNamespace($prefix, $namespaces['']);
438
-                $nodes = $data->xpath('./' . $prefix . ':' . $name);
438
+                $nodes = $data->xpath('./'.$prefix.':'.$name);
439 439
             } else {
440
-                $nodes = $data->xpath('./' . $name);
440
+                $nodes = $data->xpath('./'.$name);
441 441
             }
442 442
 
443 443
             if (empty($nodes)) {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             $this->setCurrentMetadata($metadata);
452 452
         }
453 453
 
454
-        if (!$metadata->type) {
454
+        if ( ! $metadata->type) {
455 455
             throw RuntimeException::noMetadataForProperty($metadata->class, $metadata->name);
456 456
         }
457 457
 
Please login to merge, or discard this patch.