@@ -119,7 +119,7 @@ |
||
| 119 | 119 | /** |
| 120 | 120 | * @inheritDoc |
| 121 | 121 | */ |
| 122 | - public function getDocComment(): string|false |
|
| 122 | + public function getDocComment(): string | false |
|
| 123 | 123 | { |
| 124 | 124 | $docBlock = $this->classConstantNode->getDocComment(); |
| 125 | 125 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return parent::getClosureThis(); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - public function getDocComment(): string|false |
|
| 74 | + public function getDocComment(): string | false |
|
| 75 | 75 | { |
| 76 | 76 | $docComment = $this->functionLikeNode->getDocComment(); |
| 77 | 77 | |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | return null; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public function getExtensionName(): string|false |
|
| 91 | + public function getExtensionName(): string | false |
|
| 92 | 92 | { |
| 93 | 93 | return false; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function getFileName(): string|false |
|
| 96 | + public function getFileName(): string | false |
|
| 97 | 97 | { |
| 98 | 98 | return $this->functionLikeNode->getAttribute('fileName'); |
| 99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) { |
| 107 | 107 | $functionName = $this->functionLikeNode->name->toString(); |
| 108 | 108 | |
| 109 | - return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName; |
|
| 109 | + return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return ''; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | foreach ($this->functionLikeNode->getParams() as $parameterIndex => $parameterNode) { |
| 159 | 159 | $reflectionParameter = new ReflectionParameter( |
| 160 | 160 | $this->getName(), |
| 161 | - (string)$parameterNode->var->name, |
|
| 161 | + (string) $parameterNode->var->name, |
|
| 162 | 162 | $parameterNode, |
| 163 | 163 | $parameterIndex, |
| 164 | 164 | $this |
@@ -147,19 +147,19 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $buildString = static function (array $items, $indentLevel = 4) { |
|
| 150 | + $buildString = static function(array $items, $indentLevel = 4) { |
|
| 151 | 151 | if (!count($items)) { |
| 152 | 152 | return ''; |
| 153 | 153 | } |
| 154 | - $indent = "\n" . str_repeat(' ', $indentLevel); |
|
| 154 | + $indent = "\n".str_repeat(' ', $indentLevel); |
|
| 155 | 155 | |
| 156 | - return $indent . implode($indent, explode("\n", implode("\n", $items))); |
|
| 156 | + return $indent.implode($indent, explode("\n", implode("\n", $items))); |
|
| 157 | 157 | }; |
| 158 | 158 | |
| 159 | - $buildConstants = static function (array $items, $indentLevel = 4) { |
|
| 159 | + $buildConstants = static function(array $items, $indentLevel = 4) { |
|
| 160 | 160 | $str = ''; |
| 161 | 161 | foreach ($items as $name => $value) { |
| 162 | - $str .= "\n" . str_repeat(' ', $indentLevel); |
|
| 162 | + $str .= "\n".str_repeat(' ', $indentLevel); |
|
| 163 | 163 | $str .= sprintf( |
| 164 | 164 | 'Constant [ %s %s ] { %s }', |
| 165 | 165 | gettype($value), |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | ($isObject ? 'Object of class' : 'Class'), |
| 185 | 185 | $modifiers, |
| 186 | 186 | $this->getName(), |
| 187 | - false !== $parentClass ? (' extends ' . $parentClass->getName()) : '', |
|
| 188 | - $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '', |
|
| 187 | + false !== $parentClass ? (' extends '.$parentClass->getName()) : '', |
|
| 188 | + $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '', |
|
| 189 | 189 | $this->getFileName(), |
| 190 | 190 | $this->getStartLine(), |
| 191 | 191 | $this->getEndLine(), |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | { |
| 227 | 227 | if (!isset($this->constants)) { |
| 228 | 228 | $this->constants = $this->recursiveCollect( |
| 229 | - function (array &$result, \ReflectionClass $instance) { |
|
| 229 | + function(array &$result, \ReflectionClass $instance) { |
|
| 230 | 230 | $result += $instance->getConstants(); |
| 231 | 231 | } |
| 232 | 232 | ); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | /** |
| 291 | 291 | * {@inheritDoc} |
| 292 | 292 | */ |
| 293 | - public function getDocComment(): string|false |
|
| 293 | + public function getDocComment(): string | false |
|
| 294 | 294 | { |
| 295 | 295 | $docComment = $this->classLikeNode->getDocComment(); |
| 296 | 296 | |
@@ -307,12 +307,12 @@ discard block |
||
| 307 | 307 | return null; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - public function getExtensionName(): string|false |
|
| 310 | + public function getExtensionName(): string | false |
|
| 311 | 311 | { |
| 312 | 312 | return false; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - public function getFileName(): string|false |
|
| 315 | + public function getFileName(): string | false |
|
| 316 | 316 | { |
| 317 | 317 | return $this->classLikeNode->getAttribute('fileName'); |
| 318 | 318 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | { |
| 333 | 333 | if (!isset($this->interfaceClasses)) { |
| 334 | 334 | $this->interfaceClasses = $this->recursiveCollect( |
| 335 | - function (array &$result, \ReflectionClass $instance) { |
|
| 335 | + function(array &$result, \ReflectionClass $instance) { |
|
| 336 | 336 | if ($instance->isInterface()) { |
| 337 | 337 | $result[$instance->name] = $instance; |
| 338 | 338 | } |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | if (!isset($this->methods)) { |
| 373 | 373 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); |
| 374 | 374 | $parentMethods = $this->recursiveCollect( |
| 375 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 375 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 376 | 376 | $reflectionMethods = []; |
| 377 | 377 | foreach ($instance->getMethods() as $reflectionMethod) { |
| 378 | 378 | if (!$isParent || !$reflectionMethod->isPrivate()) { |
@@ -437,9 +437,9 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | public function getName(): string |
| 439 | 439 | { |
| 440 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
| 440 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
| 441 | 441 | |
| 442 | - return $namespaceName . $this->getShortName(); |
|
| 442 | + return $namespaceName.$this->getShortName(); |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | /** |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | /** |
| 454 | 454 | * {@inheritDoc} |
| 455 | 455 | */ |
| 456 | - public function getParentClass(): \ReflectionClass|false |
|
| 456 | + public function getParentClass(): \ReflectionClass | false |
|
| 457 | 457 | { |
| 458 | 458 | if (!isset($this->parentClass)) { |
| 459 | 459 | static $extendsField = 'extends'; |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | if (!isset($this->properties)) { |
| 485 | 485 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
| 486 | 486 | $parentProperties = $this->recursiveCollect( |
| 487 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 487 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 488 | 488 | $reflectionProperties = []; |
| 489 | 489 | foreach ($instance->getProperties() as $reflectionProperty) { |
| 490 | 490 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | /** |
| 535 | 535 | * @inheritDoc |
| 536 | 536 | */ |
| 537 | - public function getReflectionConstant($name): \ReflectionClassConstant|false |
|
| 537 | + public function getReflectionConstant($name): \ReflectionClassConstant | false |
|
| 538 | 538 | { |
| 539 | 539 | $classConstants = $this->getReflectionConstants(); |
| 540 | 540 | foreach ($classConstants as $classConstant) { |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $this->getName() |
| 558 | 558 | ); |
| 559 | 559 | $parentClassConstants = $this->recursiveCollect( |
| 560 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 560 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 561 | 561 | $reflectionClassConstants = []; |
| 562 | 562 | foreach ($instance->getReflectionConstants() as $reflectionClassConstant) { |
| 563 | 563 | if (!$isParent || !$reflectionClassConstant->isPrivate()) { |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | break; |
| 611 | 611 | } |
| 612 | 612 | } |
| 613 | - $aliases[$adaptation->newName] = $traitName . '::' . $methodName; |
|
| 613 | + $aliases[$adaptation->newName] = $traitName.'::'.$methodName; |
|
| 614 | 614 | } |
| 615 | 615 | } |
| 616 | 616 | |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * @return string|false The doc comment if it exists, otherwise "false" |
| 167 | 167 | */ |
| 168 | - public function getDocComment(): string|false |
|
| 168 | + public function getDocComment(): string | false |
|
| 169 | 169 | { |
| 170 | 170 | $docComment = false; |
| 171 | 171 | $comments = $this->namespaceNode->getAttribute('comments'); |
| 172 | 172 | |
| 173 | 173 | if ($comments) { |
| 174 | - $docComment = (string)$comments[0]; |
|
| 174 | + $docComment = (string) $comments[0]; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $docComment; |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 319 | 319 | if ($namespaceLevelNode instanceof ClassLike) { |
| 320 | 320 | $classShortName = $namespaceLevelNode->name->toString(); |
| 321 | - $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName; |
|
| 321 | + $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName; |
|
| 322 | 322 | |
| 323 | 323 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 324 | 324 | $classes[$className] = new ReflectionClass($className, $namespaceLevelNode); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 343 | 343 | if ($namespaceLevelNode instanceof Function_) { |
| 344 | 344 | $funcShortName = $namespaceLevelNode->name->toString(); |
| 345 | - $functionName = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName; |
|
| 345 | + $functionName = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName; |
|
| 346 | 346 | |
| 347 | 347 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 348 | 348 | $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | if ($namespaceLevelNode instanceof Expression |
| 383 | 383 | && $namespaceLevelNode->expr instanceof FuncCall |
| 384 | 384 | && $namespaceLevelNode->expr->name instanceof Name |
| 385 | - && (string)$namespaceLevelNode->expr->name === 'define' |
|
| 385 | + && (string) $namespaceLevelNode->expr->name === 'define' |
|
| 386 | 386 | ) { |
| 387 | 387 | $functionCallNode = $namespaceLevelNode->expr; |
| 388 | 388 | $expressionSolver->process($functionCallNode->args[0]->value); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $defaultValueFromDisplay = implode(' = ', $list); |
| 129 | 129 | |
| 130 | - $defaultValueDisplay = '= ' . rtrim($defaultValueFromDisplay, ' ]' . PHP_EOL); |
|
| 130 | + $defaultValueDisplay = '= '.rtrim($defaultValueFromDisplay, ' ]'.PHP_EOL); |
|
| 131 | 131 | |
| 132 | 132 | if (is_array($defaultValue) && str_starts_with($defaultValueDisplay, '= [')) { |
| 133 | 133 | $defaultValueDisplay .= ']'; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * @inheritDoc |
| 155 | 155 | */ |
| 156 | - public function getDocComment(): string|false |
|
| 156 | + public function getDocComment(): string | false |
|
| 157 | 157 | { |
| 158 | 158 | $docBlock = $this->propertyTypeNode->getDocComment(); |
| 159 | 159 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | protected function resolveScalarMagicConstMethod(): string |
| 159 | 159 | { |
| 160 | 160 | if ($this->context instanceof ReflectionMethod) { |
| 161 | - $fullName = $this->context->getDeclaringClass()->name . '::' . $this->context->getShortName(); |
|
| 161 | + $fullName = $this->context->getDeclaringClass()->name.'::'.$this->context->getShortName(); |
|
| 162 | 162 | |
| 163 | 163 | return $fullName; |
| 164 | 164 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName); |
| 250 | 250 | if ($fileNamespace->hasConstant($constantName)) { |
| 251 | 251 | $constantValue = $fileNamespace->getConstant($constantName); |
| 252 | - $constantName = $fileNamespace->getName() . '\\' . $constantName; |
|
| 252 | + $constantName = $fileNamespace->getName().'\\'.$constantName; |
|
| 253 | 253 | $isResolved = true; |
| 254 | 254 | } |
| 255 | 255 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | if ($this->isParameter) { |
| 266 | 266 | if (isset($namespaceName)) { |
| 267 | - return $namespaceName . '\\' . $this->constantName; |
|
| 267 | + return $namespaceName.'\\'.$this->constantName; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | return $this->constantName; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $reason = 'Unable'; |
| 284 | 284 | if ($classToReflect instanceof Expr) { |
| 285 | 285 | $methodName = $this->getDispatchMethodFor($classToReflect); |
| 286 | - $reason = "Method " . __CLASS__ . "::{$methodName}() not found trying"; |
|
| 286 | + $reason = "Method ".__CLASS__."::{$methodName}() not found trying"; |
|
| 287 | 287 | } |
| 288 | 288 | throw new ReflectionException("$reason to resolve class constant."); |
| 289 | 289 | } |
@@ -301,13 +301,13 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | if ($node->class instanceof Name && $node->class->isSpecialClassName() && $this->isParameter) { |
| 303 | 303 | $this->isConstant = true; |
| 304 | - $this->constantName = $node->class . '::' . $constantName; |
|
| 304 | + $this->constantName = $node->class.'::'.$constantName; |
|
| 305 | 305 | |
| 306 | 306 | return $this->constantName; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | $this->isConstant = true; |
| 310 | - $this->constantName = $classToReflect . '::' . $constantName; |
|
| 310 | + $this->constantName = $classToReflect.'::'.$constantName; |
|
| 311 | 311 | |
| 312 | 312 | return $refClass->getConstant($constantName); |
| 313 | 313 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | return $printer->prettyPrintExpr($node); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
| 399 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | protected function resolveExprTernary(Expr\Ternary $node) |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | { |
| 482 | 482 | $nodeType = $node->getType(); |
| 483 | 483 | |
| 484 | - return 'resolve' . str_replace('_', '', $nodeType); |
|
| 484 | + return 'resolve'.str_replace('_', '', $nodeType); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /** |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | public function __debugInfo(): array |
| 128 | 128 | { |
| 129 | 129 | return [ |
| 130 | - 'name' => (string)$this->parameterNode->var->name, |
|
| 130 | + 'name' => (string) $this->parameterNode->var->name, |
|
| 131 | 131 | ]; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | 'Parameter #%d [ %s %s%s%s$%s%s ]', |
| 168 | 168 | $this->parameterIndex, |
| 169 | 169 | $isOptional ? '<optional>' : '<required>', |
| 170 | - $parameterType ? ReflectionType::convertToDisplayType($parameterType) . ' ' : '', |
|
| 170 | + $parameterType ? ReflectionType::convertToDisplayType($parameterType).' ' : '', |
|
| 171 | 171 | $this->isVariadic() ? '...' : '', |
| 172 | 172 | $this->isPassedByReference() ? '&' : '', |
| 173 | 173 | $this->getName(), |
| 174 | - ($isOptional && $hasDefaultValue) ? (' = ' . $defaultValue) : '' |
|
| 174 | + ($isOptional && $hasDefaultValue) ? (' = '.$defaultValue) : '' |
|
| 175 | 175 | ); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | /** |
| 272 | 272 | * {@inheritDoc} |
| 273 | 273 | */ |
| 274 | - public function getDefaultValueConstantName(): null|string |
|
| 274 | + public function getDefaultValueConstantName(): null | string |
|
| 275 | 275 | { |
| 276 | 276 | if (!$this->isDefaultValueAvailable()) { |
| 277 | 277 | throw new ReflectionException('Internal error: Failed to retrieve the default value'); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function getName(): string |
| 287 | 287 | { |
| 288 | - return (string)$this->parameterNode->var->name; |
|
| 288 | + return (string) $this->parameterNode->var->name; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public function isDefaultValueAvailable(): bool |
| 359 | 359 | { |
| 360 | - if (! isset($this->parameterNode->default)) { |
|
| 360 | + if (!isset($this->parameterNode->default)) { |
|
| 361 | 361 | return false; |
| 362 | 362 | } |
| 363 | 363 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | continue; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - if (! $parameter->default instanceof Expr) { |
|
| 372 | + if (!$parameter->default instanceof Expr) { |
|
| 373 | 373 | return false; |
| 374 | 374 | } |
| 375 | 375 | } |