@@ -93,13 +93,13 @@ |
||
93 | 93 | if ($type instanceof ReflectionNamedType) { |
94 | 94 | $displayType = $type->getName(); |
95 | 95 | } else { |
96 | - $displayType = (string)$type; |
|
96 | + $displayType = (string) $type; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $displayType = ltrim($displayType, '\\'); |
100 | 100 | |
101 | 101 | if ($type->allowsNull()) { |
102 | - $displayType = '?' . $displayType; |
|
102 | + $displayType = '?'.$displayType; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | return $displayType; |
@@ -24,5 +24,5 @@ |
||
24 | 24 | * |
25 | 25 | * @return string|false Path to the file with given class or false if not found |
26 | 26 | */ |
27 | - public function locateClass(string $className): bool|string; |
|
27 | + public function locateClass(string $className): bool | string; |
|
28 | 28 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * |
59 | 59 | * @return string|false Path to the file with given class or false if not found |
60 | 60 | */ |
61 | - public function locateClass(string $className): bool|string |
|
61 | + public function locateClass(string $className): bool | string |
|
62 | 62 | { |
63 | 63 | $filePath = $this->loader->findFile(ltrim($className, '\\')); |
64 | 64 | if (!empty($filePath)) { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * |
37 | 37 | * @return string|false Path to the file with given class or false if not found |
38 | 38 | */ |
39 | - public function locateClass(string $className): bool|string |
|
39 | + public function locateClass(string $className): bool | string |
|
40 | 40 | { |
41 | 41 | return call_user_func($this->callable, ltrim($className, '\\')); |
42 | 42 | } |
@@ -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) |
@@ -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': |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $namespaceName .= '\\'; |
136 | 136 | } |
137 | 137 | |
138 | - $default = $namespaceName . $defaultNode->name->toString(); |
|
138 | + $default = $namespaceName.$defaultNode->name->toString(); |
|
139 | 139 | $checkType = false; |
140 | 140 | } |
141 | 141 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if (PHP_VERSION_ID < 80100) { |
172 | 172 | // If longer than 15 characters, truncate it |
173 | 173 | if (strlen($default) > 15) { |
174 | - $default = substr($default, 0, 15) . '...'; |
|
174 | + $default = substr($default, 0, 15).'...'; |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $afterPoint = strlen(substr((string) strrchr((string) $default, "."), 1)); |
192 | 192 | $default = (string) round($default, 15); |
193 | 193 | if (!str_contains((string) $default, '.')) { |
194 | - $default .= '.' . $afterPoint; |
|
194 | + $default .= '.'.$afterPoint; |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | break; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @return PropertyProperty|Param |
244 | 244 | */ |
245 | - public function getNode(): PropertyProperty|Param |
|
245 | + public function getNode(): PropertyProperty | Param |
|
246 | 246 | { |
247 | 247 | if ($this->isPromoted()) { |
248 | 248 | return $this->paramNode; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | /** |
313 | 313 | * {@inheritDoc} |
314 | 314 | */ |
315 | - public function getDocComment(): string|false |
|
315 | + public function getDocComment(): string | false |
|
316 | 316 | { |
317 | 317 | if ($this->isPromoted()) { |
318 | 318 | $docBlock = $this->paramNode->getDocComment(); |
@@ -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 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * |
63 | 63 | * @return bool|ReflectionFileNamespace |
64 | 64 | */ |
65 | - public function getFileNamespace(string $namespaceName): ReflectionFileNamespace|bool |
|
65 | + public function getFileNamespace(string $namespaceName): ReflectionFileNamespace | bool |
|
66 | 66 | { |
67 | 67 | if ($this->hasFileNamespace($namespaceName)) { |
68 | 68 | return $this->fileNamespaces[$namespaceName]; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | protected function resolveScalarMagicConstMethod(): string |
149 | 149 | { |
150 | 150 | if ($this->context instanceof ReflectionMethod) { |
151 | - $fullName = $this->context->getDeclaringClass()->name . '::' . $this->context->getShortName(); |
|
151 | + $fullName = $this->context->getDeclaringClass()->name.'::'.$this->context->getShortName(); |
|
152 | 152 | |
153 | 153 | return $fullName; |
154 | 154 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName); |
249 | 249 | if ($fileNamespace->hasConstant($constantName)) { |
250 | 250 | $constantValue = $fileNamespace->getConstant($constantName); |
251 | - $constantName = $fileNamespace->getName() . '\\' . $constantName; |
|
251 | + $constantName = $fileNamespace->getName().'\\'.$constantName; |
|
252 | 252 | $isResolved = true; |
253 | 253 | } |
254 | 254 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $reason = 'Unable'; |
283 | 283 | if ($classToReflect instanceof Expr) { |
284 | 284 | $methodName = $this->getDispatchMethodFor($classToReflect); |
285 | - $reason = "Method " . __CLASS__ . "::$methodName() not found trying"; |
|
285 | + $reason = "Method ".__CLASS__."::$methodName() not found trying"; |
|
286 | 286 | } |
287 | 287 | throw new ReflectionException("$reason to resolve class constant."); |
288 | 288 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | } |
300 | 300 | |
301 | 301 | $this->isConstant = true; |
302 | - $this->constantName = $classToReflect . '::' . $constantName; |
|
302 | + $this->constantName = $classToReflect.'::'.$constantName; |
|
303 | 303 | |
304 | 304 | return $refClass->getConstant($constantName); |
305 | 305 | } |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | return $this->resolve($node->left) - $this->resolve($node->right); |
327 | 327 | } |
328 | 328 | |
329 | - protected function resolveExprBinaryOpMul(Expr\BinaryOp\Mul $node): float|int |
|
329 | + protected function resolveExprBinaryOpMul(Expr\BinaryOp\Mul $node): float | int |
|
330 | 330 | { |
331 | 331 | return $this->resolve($node->left) * $this->resolve($node->right); |
332 | 332 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | return $this->resolve($node->left) ** $this->resolve($node->right); |
337 | 337 | } |
338 | 338 | |
339 | - protected function resolveExprBinaryOpDiv(Expr\BinaryOp\Div $node): float|int |
|
339 | + protected function resolveExprBinaryOpDiv(Expr\BinaryOp\Div $node): float | int |
|
340 | 340 | { |
341 | 341 | return $this->resolve($node->left) / $this->resolve($node->right); |
342 | 342 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | return !$this->resolve($node->expr); |
352 | 352 | } |
353 | 353 | |
354 | - protected function resolveExprBitwiseNot(Expr\BitwiseNot $node): int|string |
|
354 | + protected function resolveExprBitwiseNot(Expr\BitwiseNot $node): int | string |
|
355 | 355 | { |
356 | 356 | return ~$this->resolve($node->expr); |
357 | 357 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node): string |
385 | 385 | { |
386 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
386 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | protected function resolveExprTernary(Expr\Ternary $node) |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | { |
474 | 474 | $nodeType = $node->getType(); |
475 | 475 | |
476 | - return 'resolve' . str_replace('_', '', $nodeType); |
|
476 | + return 'resolve'.str_replace('_', '', $nodeType); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |