@@ -120,7 +120,7 @@ |
||
| 120 | 120 | /** |
| 121 | 121 | * {@inheritDoc} |
| 122 | 122 | */ |
| 123 | - public function getDocComment(): bool|string |
|
| 123 | + public function getDocComment(): bool | string |
|
| 124 | 124 | { |
| 125 | 125 | $docBlock = $this->classConstantNode->getDocComment(); |
| 126 | 126 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * @var BaseReflectionClass|false|null |
| 102 | 102 | */ |
| 103 | - protected null|BaseReflectionClass|false $parentClass; |
|
| 103 | + protected null | BaseReflectionClass | false $parentClass; |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * @var ReflectionProperty[]|null |
@@ -149,19 +149,19 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $buildString = static function (array $items, $indentLevel = 4) { |
|
| 152 | + $buildString = static function(array $items, $indentLevel = 4) { |
|
| 153 | 153 | if (!count($items)) { |
| 154 | 154 | return ''; |
| 155 | 155 | } |
| 156 | - $indent = "\n" . str_repeat(' ', $indentLevel); |
|
| 156 | + $indent = "\n".str_repeat(' ', $indentLevel); |
|
| 157 | 157 | |
| 158 | - return $indent . implode($indent, explode("\n", implode("\n", $items))); |
|
| 158 | + return $indent.implode($indent, explode("\n", implode("\n", $items))); |
|
| 159 | 159 | }; |
| 160 | 160 | |
| 161 | - $buildConstants = static function (array $items, $indentLevel = 4) { |
|
| 161 | + $buildConstants = static function(array $items, $indentLevel = 4) { |
|
| 162 | 162 | $str = ''; |
| 163 | 163 | foreach ($items as $name => $value) { |
| 164 | - $str .= "\n" . str_repeat(' ', $indentLevel); |
|
| 164 | + $str .= "\n".str_repeat(' ', $indentLevel); |
|
| 165 | 165 | $str .= sprintf( |
| 166 | 166 | 'Constant [ %s %s ] { %s }', |
| 167 | 167 | gettype($value), |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | ($isObject ? 'Object of class' : 'Class'), |
| 187 | 187 | $modifiers, |
| 188 | 188 | $this->getName(), |
| 189 | - false !== $parentClass ? (' extends ' . $parentClass->getName()) : '', |
|
| 190 | - $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '', |
|
| 189 | + false !== $parentClass ? (' extends '.$parentClass->getName()) : '', |
|
| 190 | + $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '', |
|
| 191 | 191 | $this->getFileName(), |
| 192 | 192 | $this->getStartLine(), |
| 193 | 193 | $this->getEndLine(), |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | ): array { |
| 231 | 231 | if (!isset($this->constants)) { |
| 232 | 232 | $this->constants = $this->recursiveCollect( |
| 233 | - function (array &$result, BaseReflectionClass $instance) { |
|
| 233 | + function(array &$result, BaseReflectionClass $instance) { |
|
| 234 | 234 | $result += $instance->getConstants(); |
| 235 | 235 | } |
| 236 | 236 | ); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | /** |
| 294 | 294 | * {@inheritDoc} |
| 295 | 295 | */ |
| 296 | - public function getDocComment(): string|false |
|
| 296 | + public function getDocComment(): string | false |
|
| 297 | 297 | { |
| 298 | 298 | $docComment = $this->classLikeNode->getDocComment(); |
| 299 | 299 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | /** |
| 304 | 304 | * {@inheritDoc} |
| 305 | 305 | */ |
| 306 | - public function getEndLine(): int|false |
|
| 306 | + public function getEndLine(): int | false |
|
| 307 | 307 | { |
| 308 | 308 | return $this->classLikeNode->getAttribute('endLine'); |
| 309 | 309 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | /** |
| 325 | 325 | * {@inheritDoc} |
| 326 | 326 | */ |
| 327 | - public function getExtensionName(): string|false |
|
| 327 | + public function getExtensionName(): string | false |
|
| 328 | 328 | { |
| 329 | 329 | return false; |
| 330 | 330 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | /** |
| 333 | 333 | * {@inheritDoc} |
| 334 | 334 | */ |
| 335 | - public function getFileName(): string|false |
|
| 335 | + public function getFileName(): string | false |
|
| 336 | 336 | { |
| 337 | 337 | return $this->classLikeNode->getAttribute('fileName'); |
| 338 | 338 | } |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | { |
| 353 | 353 | if (!isset($this->interfaceClasses)) { |
| 354 | 354 | $this->interfaceClasses = $this->recursiveCollect( |
| 355 | - function (array &$result, BaseReflectionClass $instance) { |
|
| 355 | + function(array &$result, BaseReflectionClass $instance) { |
|
| 356 | 356 | if ($instance->isInterface()) { |
| 357 | 357 | $result[$instance->name] = $instance; |
| 358 | 358 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | if (!isset($this->methods)) { |
| 396 | 396 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); |
| 397 | 397 | $parentMethods = $this->recursiveCollect( |
| 398 | - function (array &$result, BaseReflectionClass $instance, $isParent) { |
|
| 398 | + function(array &$result, BaseReflectionClass $instance, $isParent) { |
|
| 399 | 399 | $reflectionMethods = []; |
| 400 | 400 | foreach ($instance->getMethods() as $reflectionMethod) { |
| 401 | 401 | if (!$isParent || !$reflectionMethod->isPrivate()) { |
@@ -439,9 +439,9 @@ discard block |
||
| 439 | 439 | */ |
| 440 | 440 | public function getName(): string |
| 441 | 441 | { |
| 442 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
| 442 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
| 443 | 443 | |
| 444 | - return $namespaceName . $this->getShortName(); |
|
| 444 | + return $namespaceName.$this->getShortName(); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | * @return ReflectionClass|false A {@see ReflectionClass} or {@see false} |
| 461 | 461 | * if there's no parent. |
| 462 | 462 | */ |
| 463 | - public function getParentClass(): BaseReflectionClass|false |
|
| 463 | + public function getParentClass(): BaseReflectionClass | false |
|
| 464 | 464 | { |
| 465 | 465 | if (!isset($this->parentClass)) { |
| 466 | 466 | static $extendsField = 'extends'; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | if (!isset($this->properties)) { |
| 487 | 487 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
| 488 | 488 | $parentProperties = $this->recursiveCollect( |
| 489 | - function (array &$result, BaseReflectionClass $instance, $isParent) { |
|
| 489 | + function(array &$result, BaseReflectionClass $instance, $isParent) { |
|
| 490 | 490 | $reflectionProperties = []; |
| 491 | 491 | foreach ($instance->getProperties() as $reflectionProperty) { |
| 492 | 492 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | * |
| 550 | 550 | * @return ReflectionClassConstant|false A {@see ReflectionClassConstant}. |
| 551 | 551 | */ |
| 552 | - public function getReflectionConstant(string $name): BaseReflectionClassConstant|false |
|
| 552 | + public function getReflectionConstant(string $name): BaseReflectionClassConstant | false |
|
| 553 | 553 | { |
| 554 | 554 | $classConstants = $this->getReflectionConstants(); |
| 555 | 555 | foreach ($classConstants as $classConstant) { |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | $this->getName() |
| 576 | 576 | ); |
| 577 | 577 | $parentClassConstants = $this->recursiveCollect( |
| 578 | - function (array &$result, BaseReflectionClass $instance, $isParent) { |
|
| 578 | + function(array &$result, BaseReflectionClass $instance, $isParent) { |
|
| 579 | 579 | $reflectionClassConstants = []; |
| 580 | 580 | foreach ($instance->getReflectionConstants() as $reflectionClassConstant) { |
| 581 | 581 | if (!$isParent || !$reflectionClassConstant->isPrivate()) { |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | /** |
| 605 | 605 | * {@inheritDoc} |
| 606 | 606 | */ |
| 607 | - public function getStartLine(): int|false |
|
| 607 | + public function getStartLine(): int | false |
|
| 608 | 608 | { |
| 609 | 609 | return $this->classLikeNode->getAttribute('startLine'); |
| 610 | 610 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | break; |
| 627 | 627 | } |
| 628 | 628 | } |
| 629 | - $aliases[$adaptation->newName] = $traitName . '::' . $methodName; |
|
| 629 | + $aliases[$adaptation->newName] = $traitName.'::'.$methodName; |
|
| 630 | 630 | } |
| 631 | 631 | } |
| 632 | 632 | |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | * |
| 709 | 709 | * @return bool Returns {@see true} on success or {@see false} on failure. |
| 710 | 710 | */ |
| 711 | - public function implementsInterface(BaseReflectionClass|string $interface): bool |
|
| 711 | + public function implementsInterface(BaseReflectionClass | string $interface): bool |
|
| 712 | 712 | { |
| 713 | 713 | $allInterfaces = $this->getInterfaces(); |
| 714 | 714 | |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | * |
| 841 | 841 | * @return bool {@see true} on success or {@see false} on failure. |
| 842 | 842 | */ |
| 843 | - public function isSubclassOf(BaseReflectionClass|string $class): bool |
|
| 843 | + public function isSubclassOf(BaseReflectionClass | string $class): bool |
|
| 844 | 844 | { |
| 845 | 845 | if ($class instanceof ReflectionClass) { |
| 846 | 846 | $className = $class->name; |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | return parent::getClosureThis(); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public function getDocComment(): string|false |
|
| 77 | + public function getDocComment(): string | false |
|
| 78 | 78 | { |
| 79 | 79 | $docComment = $this->functionLikeNode->getDocComment(); |
| 80 | 80 | |
| 81 | 81 | return $docComment ? $docComment->getText() : false; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function getEndLine(): int|false |
|
| 84 | + public function getEndLine(): int | false |
|
| 85 | 85 | { |
| 86 | 86 | return $this->functionLikeNode->getAttribute('endLine'); |
| 87 | 87 | } |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | return null; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public function getExtensionName(): string|false |
|
| 94 | + public function getExtensionName(): string | false |
|
| 95 | 95 | { |
| 96 | 96 | return false; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - public function getFileName(): string|false |
|
| 99 | + public function getFileName(): string | false |
|
| 100 | 100 | { |
| 101 | 101 | return $this->functionLikeNode->getAttribute('fileName'); |
| 102 | 102 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) { |
| 110 | 110 | $functionName = $this->functionLikeNode->name->toString(); |
| 111 | 111 | |
| 112 | - return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName; |
|
| 112 | + return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** @noinspection PhpMultipleClassDeclarationsInspection */ |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | foreach ($this->functionLikeNode->getParams() as $parameterIndex => $parameterNode) { |
| 167 | 167 | $reflectionParameter = new ReflectionParameter( |
| 168 | 168 | $this->getName(), |
| 169 | - (string)$parameterNode->var->name, |
|
| 169 | + (string) $parameterNode->var->name, |
|
| 170 | 170 | $parameterNode, |
| 171 | 171 | $parameterIndex, |
| 172 | 172 | $this |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return parent::getShortName(); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - public function getStartLine(): int|false |
|
| 223 | + public function getStartLine(): int | false |
|
| 224 | 224 | { |
| 225 | 225 | return $this->functionLikeNode->getAttribute('startLine'); |
| 226 | 226 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @return array|bool|string |
| 33 | 33 | */ |
| 34 | - public static function realpath(array|string $somePath, bool $shouldCheckExistence = false): bool|array|string |
|
| 34 | + public static function realpath(array | string $somePath, bool $shouldCheckExistence = false): bool | array | string |
|
| 35 | 35 | { |
| 36 | 36 | // Do not resolve empty string/false/arrays into the current path |
| 37 | 37 | if (!$somePath) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $isRelative = !$pathScheme && ($path[0] !== '/') && ($path[1] !== ':'); |
| 54 | 54 | if ($isRelative) { |
| 55 | - $path = getcwd() . DIRECTORY_SEPARATOR . $path; |
|
| 55 | + $path = getcwd().DIRECTORY_SEPARATOR.$path; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // resolve path parts (single dot, double dot and double delimiters) |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @return bool|ReflectionClass |
| 105 | 105 | */ |
| 106 | - public function getClass(string $className): bool|ReflectionClass |
|
| 106 | + public function getClass(string $className): bool | ReflectionClass |
|
| 107 | 107 | { |
| 108 | 108 | if ($this->hasClass($className)) { |
| 109 | 109 | return $this->fileClasses[$className]; |
@@ -169,13 +169,13 @@ discard block |
||
| 169 | 169 | * |
| 170 | 170 | * @return string|false The doc comment if it exists, otherwise "false" |
| 171 | 171 | */ |
| 172 | - public function getDocComment(): bool|string |
|
| 172 | + public function getDocComment(): bool | string |
|
| 173 | 173 | { |
| 174 | 174 | $docComment = false; |
| 175 | 175 | $comments = $this->namespaceNode->getAttribute('comments'); |
| 176 | 176 | |
| 177 | 177 | if ($comments) { |
| 178 | - $docComment = (string)$comments[0]; |
|
| 178 | + $docComment = (string) $comments[0]; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | return $docComment; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * |
| 205 | 205 | * @return bool|ReflectionFunction |
| 206 | 206 | */ |
| 207 | - public function getFunction(string $functionName): bool|ReflectionFunction |
|
| 207 | + public function getFunction(string $functionName): bool | ReflectionFunction |
|
| 208 | 208 | { |
| 209 | 209 | if ($this->hasFunction($functionName)) { |
| 210 | 210 | return $this->fileFunctions[$functionName]; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 325 | 325 | if ($namespaceLevelNode instanceof ClassLike) { |
| 326 | 326 | $classShortName = $namespaceLevelNode->name->toString(); |
| 327 | - $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName; |
|
| 327 | + $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName; |
|
| 328 | 328 | |
| 329 | 329 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 330 | 330 | $classes[$className] = new ReflectionClass($className, $namespaceLevelNode); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 349 | 349 | if ($namespaceLevelNode instanceof Function_) { |
| 350 | 350 | $funcShortName = $namespaceLevelNode->name->toString(); |
| 351 | - $functionName = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName; |
|
| 351 | + $functionName = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName; |
|
| 352 | 352 | |
| 353 | 353 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 354 | 354 | $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | if ($namespaceLevelNode instanceof Expression |
| 389 | 389 | && $namespaceLevelNode->expr instanceof FuncCall |
| 390 | 390 | && $namespaceLevelNode->expr->name instanceof Name |
| 391 | - && (string)$namespaceLevelNode->expr->name === 'define' |
|
| 391 | + && (string) $namespaceLevelNode->expr->name === 'define' |
|
| 392 | 392 | ) { |
| 393 | 393 | $functionCallNode = $namespaceLevelNode->expr; |
| 394 | 394 | $expressionSolver->process($functionCallNode->args[0]->value); |