@@ -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 |
@@ -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 |