@@ -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); |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | $paramString = ''; |
| 116 | 116 | $indentation = str_repeat(' ', 4); |
| 117 | 117 | foreach ($methodParameters as $methodParameter) { |
| 118 | - $paramString .= "\n$indentation" . $methodParameter; |
|
| 118 | + $paramString .= "\n$indentation".$methodParameter; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** @noinspection PhpFormatFunctionParametersMismatchInspection */ |
| 122 | 122 | return sprintf( |
| 123 | 123 | "%sMethod [ <user%s%s%s>%s%s%s %s method %s ] {\n @@ %s %d - %d$paramFormat$returnFormat\n}\n", |
| 124 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
| 124 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
| 125 | 125 | $prototype ? ", overwrites $prototypeClass, prototype $prototypeClass" : '', |
| 126 | 126 | $this->isConstructor() ? ', ctor' : '', |
| 127 | 127 | $this->isFinal() ? ' final' : '', |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * {@inheritDoc} |
| 158 | 158 | */ |
| 159 | - public function getDeclaringClass(): \ReflectionClass|ReflectionClass |
|
| 159 | + public function getDeclaringClass(): \ReflectionClass | ReflectionClass |
|
| 160 | 160 | { |
| 161 | 161 | return $this->declaringClass ?? new ReflectionClass($this->className); |
| 162 | 162 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | /** |
| 193 | 193 | * {@inheritDoc} |
| 194 | 194 | */ |
| 195 | - public function getPrototype(): BaseReflectionMethod|ReflectionMethod |
|
| 195 | + public function getPrototype(): BaseReflectionMethod | ReflectionMethod |
|
| 196 | 196 | { |
| 197 | 197 | $parent = $this->getDeclaringClass()->getParentClass(); |
| 198 | 198 | if (!$parent) { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $namespaceName .= '\\'; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $default = $namespaceName . $defaultNode->name->toString(); |
|
| 111 | + $default = $namespaceName.$defaultNode->name->toString(); |
|
| 112 | 112 | $checkType = false; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if (PHP_VERSION_ID < 80100) { |
| 145 | 145 | // If longer than 15 characters, truncate it |
| 146 | 146 | if (strlen($default) > 15) { |
| 147 | - $default = substr($default, 0, 15) . '...'; |
|
| 147 | + $default = substr($default, 0, 15).'...'; |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $afterPoint = strlen(substr((string) strrchr((string) $default, "."), 1)); |
| 165 | 165 | $default = (string) round($default, 15); |
| 166 | 166 | if (!str_contains((string) $default, '.')) { |
| 167 | - $default .= '.' . $afterPoint; |
|
| 167 | + $default .= '.'.$afterPoint; |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | break; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | /** |
| 249 | 249 | * {@inheritDoc} |
| 250 | 250 | */ |
| 251 | - public function getDeclaringClass(): \ReflectionClass|ReflectionClass |
|
| 251 | + public function getDeclaringClass(): \ReflectionClass | ReflectionClass |
|
| 252 | 252 | { |
| 253 | 253 | return new ReflectionClass($this->className); |
| 254 | 254 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * {@inheritDoc} |
| 258 | 258 | */ |
| 259 | - public function getDocComment(): string|false |
|
| 259 | + public function getDocComment(): string | false |
|
| 260 | 260 | { |
| 261 | 261 | $docBlock = $this->propertyTypeNode->getDocComment(); |
| 262 | 262 | |
@@ -148,7 +148,9 @@ |
||
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if ($quoteString === null) $quoteString = true; |
|
| 151 | + if ($quoteString === null) { |
|
| 152 | + $quoteString = true; |
|
| 153 | + } |
|
| 152 | 154 | break; |
| 153 | 155 | |
| 154 | 156 | case 'boolean': |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | /** |
| 125 | 125 | * {@inheritDoc} |
| 126 | 126 | */ |
| 127 | - public function getDocComment(): string|false |
|
| 127 | + public function getDocComment(): string | false |
|
| 128 | 128 | { |
| 129 | 129 | $docBlock = $this->classConstantNode->getDocComment(); |
| 130 | 130 | |