@@ -126,7 +126,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |