@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | public function __construct($values = [], $name = null) |
| 23 | 23 | { |
| 24 | - if ((null !== $name) && !is_string($name) && !(is_object($name) && method_exists($name, '__toString'))) { |
|
| 24 | + if ((null !== $name) && ! is_string($name) && ! (is_object($name) && method_exists($name, '__toString'))) { |
|
| 25 | 25 | throw new \RuntimeException( |
| 26 | 26 | 'Type must be either string, null or object implements __toString() method.', |
| 27 | 27 | ); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($type instanceof ArrayTypeNode) { |
| 110 | 110 | $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflector); |
| 111 | 111 | |
| 112 | - return 'array<' . $resolvedType . '>'; |
|
| 112 | + return 'array<'.$resolvedType.'>'; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product> |
@@ -117,13 +117,13 @@ discard block |
||
| 117 | 117 | if ($this->isSimpleType($type->type, 'array')) { |
| 118 | 118 | $resolvedTypes = array_map(fn (TypeNode $node) => $this->resolveTypeFromTypeNode($node, $reflector), $type->genericTypes); |
| 119 | 119 | |
| 120 | - return 'array<' . implode(',', $resolvedTypes) . '>'; |
|
| 120 | + return 'array<'.implode(',', $resolvedTypes).'>'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | if ($this->isSimpleType($type->type, 'list')) { |
| 124 | 124 | $resolvedTypes = array_map(fn (TypeNode $node) => $this->resolveTypeFromTypeNode($node, $reflector), $type->genericTypes); |
| 125 | 125 | |
| 126 | - return 'array<int, ' . implode(',', $resolvedTypes) . '>'; |
|
| 126 | + return 'array<int, '.implode(',', $resolvedTypes).'>'; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | 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())); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | return []; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - return array_merge(...array_map(static function ($node) { |
|
| 149 | + return array_merge(...array_map(static function($node) { |
|
| 150 | 150 | if ($node->type instanceof UnionTypeNode) { |
| 151 | 151 | return $node->type->types; |
| 152 | 152 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | private function resolveTypeFromTypeNode(TypeNode $typeNode, $reflector): string |
| 233 | 233 | { |
| 234 | - if (!($typeNode instanceof IdentifierTypeNode)) { |
|
| 234 | + if ( ! ($typeNode instanceof IdentifierTypeNode)) { |
|
| 235 | 235 | throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflector->getDeclaringClass()->getName(), $reflector->getName())); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | private function expandClassNameUsingUseStatements(string $typeHint, \ReflectionClass $declaringClass, $reflector): string |
| 245 | 245 | { |
| 246 | - $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint; |
|
| 246 | + $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint; |
|
| 247 | 247 | if ($this->isClassOrInterface($expandedClassName)) { |
| 248 | 248 | return $expandedClassName; |
| 249 | 249 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool |
| 283 | 283 | { |
| 284 | - $typeHintToSearchFor = '\\' . $typeHintToSearchFor; |
|
| 284 | + $typeHintToSearchFor = '\\'.$typeHintToSearchFor; |
|
| 285 | 285 | |
| 286 | 286 | return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor; |
| 287 | 287 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements); |
| 303 | 303 | for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) { |
| 304 | 304 | foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) { |
| 305 | - $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement); |
|
| 305 | + $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement); |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | */ |
| 342 | 342 | private function resolveType(string $typeHint, $reflector): string |
| 343 | 343 | { |
| 344 | - if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) { |
|
| 344 | + if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) { |
|
| 345 | 345 | $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflector), $reflector); |
| 346 | 346 | } |
| 347 | 347 | |
@@ -359,15 +359,15 @@ discard block |
||
| 359 | 359 | private function resolveTypeFromDocblock($reflector): array |
| 360 | 360 | { |
| 361 | 361 | $docComment = $reflector->getDocComment(); |
| 362 | - if (!$docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) { |
|
| 362 | + if ( ! $docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) { |
|
| 363 | 363 | $constructor = $reflector->getDeclaringClass()->getConstructor(); |
| 364 | - if (!$constructor) { |
|
| 364 | + if ( ! $constructor) { |
|
| 365 | 365 | return []; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | $docComment = $constructor->getDocComment(); |
| 369 | 369 | |
| 370 | - if (!$docComment) { |
|
| 370 | + if ( ! $docComment) { |
|
| 371 | 371 | return []; |
| 372 | 372 | } |
| 373 | 373 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | return $this->flattenParamTagValueTypes($reflector->getName(), $phpDocNode->getParamTagValues()); |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - if (!$docComment) { |
|
| 380 | + if ( ! $docComment) { |
|
| 381 | 381 | return []; |
| 382 | 382 | } |
| 383 | 383 | |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | private function buildAnnotation(array $attributes): ?SerializerAttribute |
| 74 | 74 | { |
| 75 | - if (!isset($attributes[0])) { |
|
| 75 | + if ( ! isset($attributes[0])) { |
|
| 76 | 76 | return null; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $configured = false; |
| 82 | 82 | |
| 83 | 83 | $classMetadata = new ClassMetadata($name = $class->name); |
| 84 | - $fileResource = $class->getFilename(); |
|
| 84 | + $fileResource = $class->getFilename(); |
|
| 85 | 85 | |
| 86 | 86 | if (false !== $fileResource) { |
| 87 | 87 | $classMetadata->fileResources[] = $fileResource; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - if (!$excludeAll) { |
|
| 170 | + if ( ! $excludeAll) { |
|
| 171 | 171 | foreach ($class->getProperties() as $property) { |
| 172 | 172 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
| 173 | 173 | continue; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } elseif ($annot instanceof Expose) { |
| 202 | 202 | $isExpose = true; |
| 203 | 203 | if (null !== $annot->if) { |
| 204 | - $propertyMetadata->excludeIf = $this->parseExpression('!(' . $annot->if . ')'); |
|
| 204 | + $propertyMetadata->excludeIf = $this->parseExpression('!('.$annot->if.')'); |
|
| 205 | 205 | } |
| 206 | 206 | } elseif ($annot instanceof Exclude) { |
| 207 | 207 | if (null !== $annot->if) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | throw new InvalidMetadataException(sprintf( |
| 249 | 249 | 'Invalid group name "%s" on "%s", did you mean to create multiple groups?', |
| 250 | 250 | implode(', ', $propertyMetadata->groups), |
| 251 | - $propertyMetadata->class . '->' . $propertyMetadata->name, |
|
| 251 | + $propertyMetadata->class.'->'.$propertyMetadata->name, |
|
| 252 | 252 | )); |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - if (!$propertyMetadata->serializedName) { |
|
| 273 | + if ( ! $propertyMetadata->serializedName) { |
|
| 274 | 274 | $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata); |
| 275 | 275 | } |
| 276 | 276 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | if ( |
| 284 | - (ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
| 284 | + (ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
| 285 | 285 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
| 286 | 286 | ) { |
| 287 | 287 | $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]); |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | |
| 133 | 133 | $accessor = $this->writeAccessors[$metadata->class] ?? null; |
| 134 | 134 | if (null === $accessor) { |
| 135 | - $accessor = \Closure::bind(static function ($o, $name, $value): void { |
|
| 135 | + $accessor = \Closure::bind(static function($o, $name, $value): void { |
|
| 136 | 136 | $o->$name = $value; |
| 137 | 137 | }, null, $metadata->class); |
| 138 | 138 | $this->writeAccessors[$metadata->class] = $accessor; |
@@ -104,7 +104,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 190 | 190 | $decimalsNumbers = $type['params'][2] ?? null; |
| 191 | 191 | if (null === $decimalsNumbers) { |
| 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 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $node = $this->navigator->accept($v, $metadata->type); |
| 266 | 266 | $this->revertCurrentMetadata(); |
| 267 | 267 | |
| 268 | - if (!$node instanceof \DOMCharacterData) { |
|
| 268 | + if ( ! $node instanceof \DOMCharacterData) { |
|
| 269 | 269 | throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v))); |
| 270 | 270 | } |
| 271 | 271 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | if ( |
| 278 | 278 | ($metadata->xmlValue && $this->currentNode->childNodes->length > 0) |
| 279 | - || (!$metadata->xmlValue && $this->hasValue) |
|
| 279 | + || ( ! $metadata->xmlValue && $this->hasValue) |
|
| 280 | 280 | ) { |
| 281 | 281 | 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)); |
| 282 | 282 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $node = $this->navigator->accept($v, $metadata->type); |
| 289 | 289 | $this->revertCurrentMetadata(); |
| 290 | 290 | |
| 291 | - if (!$node instanceof \DOMCharacterData) { |
|
| 291 | + if ( ! $node instanceof \DOMCharacterData) { |
|
| 292 | 292 | throw new RuntimeException(sprintf('Unsupported value for property %s::$%s. Expected character data, but got %s.', $metadata->class, $metadata->name, \is_object($node) ? \get_class($node) : \gettype($node))); |
| 293 | 293 | } |
| 294 | 294 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | if ($metadata->xmlAttributeMap) { |
| 301 | - if (!\is_array($v)) { |
|
| 301 | + if ( ! \is_array($v)) { |
|
| 302 | 302 | throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', \gettype($v))); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $node = $this->navigator->accept($value, null); |
| 308 | 308 | $this->revertCurrentMetadata(); |
| 309 | 309 | |
| 310 | - if (!$node instanceof \DOMCharacterData) { |
|
| 310 | + if ( ! $node instanceof \DOMCharacterData) { |
|
| 311 | 311 | throw new RuntimeException(sprintf('Unsupported value for a XML attribute map value. Expected character data, but got %s.', json_encode($v))); |
| 312 | 312 | } |
| 313 | 313 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | return; |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) { |
|
| 320 | + if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) { |
|
| 321 | 321 | $namespace = $metadata->xmlNamespace ?? $this->getClassDefaultNamespace($this->objectMetadataStack->top()); |
| 322 | 322 | |
| 323 | 323 | $element = $this->createElement($metadata->serializedName, $namespace); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | private function isSkippableEmptyObject(?\DOMElement $node, PropertyMetadata $metadata): bool |
| 362 | 362 | { |
| 363 | - return null === $node && !$metadata->xmlCollection && $metadata->skipWhenEmpty; |
|
| 363 | + return null === $node && ! $metadata->xmlCollection && $metadata->skipWhenEmpty; |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | private function isSkippableCollection(PropertyMetadata $metadata): bool |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | private function isElementEmpty(\DOMElement $element): bool |
| 372 | 372 | { |
| 373 | - return !$element->hasChildNodes() && !$element->hasAttributes(); |
|
| 373 | + return ! $element->hasChildNodes() && ! $element->hasAttributes(); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | public function endVisitingObject(ClassMetadata $metadata, object $data, array $type): void |
@@ -475,7 +475,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | array $type, |
| 45 | 45 | SerializationContext $context |
| 46 | 46 | ) { |
| 47 | - if ((isset($type['params'][1]) && 'value' === $type['params'][1]) || (!isset($type['params'][1]) && $enum instanceof \BackedEnum)) { |
|
| 48 | - if (!$enum instanceof \BackedEnum) { |
|
| 47 | + if ((isset($type['params'][1]) && 'value' === $type['params'][1]) || ( ! isset($type['params'][1]) && $enum instanceof \BackedEnum)) { |
|
| 48 | + if ( ! $enum instanceof \BackedEnum) { |
|
| 49 | 49 | throw new InvalidMetadataException(sprintf('The type "%s" is not a backed enum, thus you can not use "value" as serialization mode for its value.', get_class($enum))); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | $caseValue = (string) $data; |
| 68 | 68 | |
| 69 | 69 | $ref = new \ReflectionEnum($enumType); |
| 70 | - if (isset($type['params'][1]) && 'value' === $type['params'][1] || (!isset($type['params'][1]) && is_a($enumType, \BackedEnum::class, true))) { |
|
| 71 | - if (!is_a($enumType, \BackedEnum::class, true)) { |
|
| 70 | + if (isset($type['params'][1]) && 'value' === $type['params'][1] || ( ! isset($type['params'][1]) && is_a($enumType, \BackedEnum::class, true))) { |
|
| 71 | + if ( ! is_a($enumType, \BackedEnum::class, true)) { |
|
| 72 | 72 | throw new InvalidMetadataException(sprintf('The type "%s" is not a backed enum, thus you can not use "value" as serialization mode for its value.', $enumType)); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if ('int' === $ref->getBackingType()->getName()) { |
| 76 | - if (!is_numeric($caseValue)) { |
|
| 76 | + if ( ! is_numeric($caseValue)) { |
|
| 77 | 77 | throw new RuntimeException(sprintf('"%s" is not a valid backing value for enum "%s"', $caseValue, $enumType)); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | return $enumType::from($caseValue); |
| 84 | 84 | } else { |
| 85 | - if (!$ref->hasCase($caseValue)) { |
|
| 85 | + if ( ! $ref->hasCase($caseValue)) { |
|
| 86 | 86 | throw new InvalidMetadataException(sprintf('The type "%s" does not have the case "%s"', $ref->getName(), $caseValue)); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | public function createDriver(array $metadataDirs, ?Reader $annotationReader = null): DriverInterface |
| 60 | 60 | { |
| 61 | - if (PHP_VERSION_ID < 80000 && empty($metadataDirs) && !interface_exists(Reader::class)) { |
|
| 61 | + if (PHP_VERSION_ID < 80000 && empty($metadataDirs) && ! interface_exists(Reader::class)) { |
|
| 62 | 62 | throw new RuntimeException(sprintf('To use "%s", either a list of metadata directories must be provided, the "doctrine/annotations" package installed, or use PHP 8.0 or later.', self::class)); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $metadataDrivers[] = new AnnotationOrAttributeDriver($this->propertyNamingStrategy, $this->typeParser, $this->expressionEvaluator, $annotationReader); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if (!empty($metadataDirs)) { |
|
| 79 | + if ( ! empty($metadataDirs)) { |
|
| 80 | 80 | $fileLocator = new FileLocator($metadataDirs); |
| 81 | 81 | |
| 82 | 82 | array_unshift($metadataDrivers, new XmlDriver($fileLocator, $this->propertyNamingStrategy, $this->typeParser, $this->expressionEvaluator)); |
@@ -27,7 +27,7 @@ |
||
| 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 | |