@@ -78,7 +78,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | if ($type instanceof ArrayTypeNode) { |
| 112 | 112 | $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflector); |
| 113 | 113 | |
| 114 | - return 'array<' . $resolvedType . '>'; |
|
| 114 | + return 'array<'.$resolvedType.'>'; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product> |
| 118 | 118 | if ($type instanceof GenericTypeNode) { |
| 119 | 119 | $isSimpleTypeArray = $this->isSimpleType($type->type, 'array'); |
| 120 | 120 | $isSimpleTypeList = $this->isSimpleType($type->type, 'list'); |
| 121 | - if (!$isSimpleTypeArray && !$isSimpleTypeList) { |
|
| 121 | + if ( ! $isSimpleTypeArray && ! $isSimpleTypeList) { |
|
| 122 | 122 | 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())); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | return []; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - return array_merge(...array_map(static function ($node) { |
|
| 172 | + return array_merge(...array_map(static function($node) { |
|
| 173 | 173 | if ($node->type instanceof UnionTypeNode) { |
| 174 | 174 | return $node->type->types; |
| 175 | 175 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | private function resolveTypeFromTypeNode(TypeNode $typeNode, $reflector): string |
| 256 | 256 | { |
| 257 | - if (!($typeNode instanceof IdentifierTypeNode)) { |
|
| 257 | + if ( ! ($typeNode instanceof IdentifierTypeNode)) { |
|
| 258 | 258 | throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflector->getDeclaringClass()->getName(), $reflector->getName())); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | */ |
| 267 | 267 | private function expandClassNameUsingUseStatements(string $typeHint, \ReflectionClass $declaringClass, $reflector): string |
| 268 | 268 | { |
| 269 | - $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint; |
|
| 269 | + $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint; |
|
| 270 | 270 | if ($this->isClassOrInterface($expandedClassName)) { |
| 271 | 271 | return $expandedClassName; |
| 272 | 272 | } |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool |
| 306 | 306 | { |
| 307 | - $typeHintToSearchFor = '\\' . $typeHintToSearchFor; |
|
| 307 | + $typeHintToSearchFor = '\\'.$typeHintToSearchFor; |
|
| 308 | 308 | |
| 309 | 309 | return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor; |
| 310 | 310 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements); |
| 326 | 326 | for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) { |
| 327 | 327 | foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) { |
| 328 | - $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement); |
|
| 328 | + $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement); |
|
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | private function resolveType(string $typeHint, $reflector): string |
| 366 | 366 | { |
| 367 | - if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) { |
|
| 367 | + if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) { |
|
| 368 | 368 | $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflector), $reflector); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -382,15 +382,15 @@ discard block |
||
| 382 | 382 | private function resolveTypeFromDocblock($reflector): array |
| 383 | 383 | { |
| 384 | 384 | $docComment = $reflector->getDocComment(); |
| 385 | - if (!$docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) { |
|
| 385 | + if ( ! $docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) { |
|
| 386 | 386 | $constructor = $reflector->getDeclaringClass()->getConstructor(); |
| 387 | - if (!$constructor) { |
|
| 387 | + if ( ! $constructor) { |
|
| 388 | 388 | return []; |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | $docComment = $constructor->getDocComment(); |
| 392 | 392 | |
| 393 | - if (!$docComment) { |
|
| 393 | + if ( ! $docComment) { |
|
| 394 | 394 | return []; |
| 395 | 395 | } |
| 396 | 396 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | return $this->flattenParamTagValueTypes($reflector->getName(), $phpDocNode->getParamTagValues()); |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | - if (!$docComment) { |
|
| 403 | + if ( ! $docComment) { |
|
| 404 | 404 | return []; |
| 405 | 405 | } |
| 406 | 406 | |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | private function matchSimpleType(mixed $data, array $type, Context $context): mixed |
| 100 | 100 | { |
| 101 | 101 | foreach ($type['params'][0] as $possibleType) { |
| 102 | - if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
| 102 | + if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
| 103 | 103 | continue; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | assert($doctrineMetadata instanceof ORMClassMetadata || $doctrineMetadata instanceof ODMClassMetadata); |
| 22 | 22 | if ( |
| 23 | - empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled |
|
| 24 | - && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
| 23 | + empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled |
|
| 24 | + && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
| 25 | 25 | ) { |
| 26 | 26 | $classMetadata->setDiscriminator( |
| 27 | 27 | $doctrineMetadata->discriminatorColumn['name'], |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy. |
| 50 | 50 | // On serialization, this would lead to only the supertype being serialized, and properties of subtypes |
| 51 | 51 | // being ignored. |
| 52 | - if ($targetMetadata instanceof ODMClassMetadata && !$targetMetadata->isInheritanceTypeNone()) { |
|
| 52 | + if ($targetMetadata instanceof ODMClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 56 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 57 | 57 | $targetEntity = sprintf('ArrayCollection<%s>', $targetEntity); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -59,7 +59,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |