@@ -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; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @var Node[] |
45 | 45 | */ |
46 | - private Node|array $topLevelNodes; |
|
46 | + private Node | array $topLevelNodes; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * ReflectionFile constructor. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * |
66 | 66 | * @return bool|ReflectionFileNamespace |
67 | 67 | */ |
68 | - public function getFileNamespace(string $namespaceName): ReflectionFileNamespace|bool |
|
68 | + public function getFileNamespace(string $namespaceName): ReflectionFileNamespace | bool |
|
69 | 69 | { |
70 | 70 | if ($this->hasFileNamespace($namespaceName)) { |
71 | 71 | return $this->fileNamespaces[$namespaceName]; |
@@ -523,7 +523,7 @@ |
||
523 | 523 | |
524 | 524 | if (method_exists($this->context, 'getDeclaringClass')) { |
525 | 525 | return $this->context->getDeclaringClass() |
526 | - ->getParentClass(); |
|
526 | + ->getParentClass(); |
|
527 | 527 | } |
528 | 528 | } |
529 | 529 |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | protected function resolveScalarMagicConstMethod(): string |
151 | 151 | { |
152 | 152 | if ($this->context instanceof ReflectionMethod) { |
153 | - $fullName = $this->context->getDeclaringClass()->name . '::' . $this->context->getShortName(); |
|
153 | + $fullName = $this->context->getDeclaringClass()->name.'::'.$this->context->getShortName(); |
|
154 | 154 | |
155 | 155 | return $fullName; |
156 | 156 | } |
@@ -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 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $reason = 'Unable'; |
282 | 282 | if ($classToReflect instanceof Expr) { |
283 | 283 | $methodName = $this->getDispatchMethodFor($classToReflect); |
284 | - $reason = "Method " . __CLASS__ . "::$methodName() not found trying"; |
|
284 | + $reason = "Method ".__CLASS__."::$methodName() not found trying"; |
|
285 | 285 | } |
286 | 286 | throw new ReflectionException("$reason to resolve class constant."); |
287 | 287 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | |
300 | 300 | $this->isConstant = true; |
301 | - $this->constantName = $classToReflect . '::' . $constantName; |
|
301 | + $this->constantName = $classToReflect.'::'.$constantName; |
|
302 | 302 | |
303 | 303 | return $refClass->getConstant($constantName); |
304 | 304 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | return $this->resolve($node->left) - $this->resolve($node->right); |
326 | 326 | } |
327 | 327 | |
328 | - protected function resolveExprBinaryOpMul(Expr\BinaryOp\Mul $node): float|int |
|
328 | + protected function resolveExprBinaryOpMul(Expr\BinaryOp\Mul $node): float | int |
|
329 | 329 | { |
330 | 330 | return $this->resolve($node->left) * $this->resolve($node->right); |
331 | 331 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | return $this->resolve($node->left) ** $this->resolve($node->right); |
336 | 336 | } |
337 | 337 | |
338 | - protected function resolveExprBinaryOpDiv(Expr\BinaryOp\Div $node): float|int |
|
338 | + protected function resolveExprBinaryOpDiv(Expr\BinaryOp\Div $node): float | int |
|
339 | 339 | { |
340 | 340 | return $this->resolve($node->left) / $this->resolve($node->right); |
341 | 341 | } |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | return !$this->resolve($node->expr); |
351 | 351 | } |
352 | 352 | |
353 | - protected function resolveExprBitwiseNot(Expr\BitwiseNot $node): int|string |
|
353 | + protected function resolveExprBitwiseNot(Expr\BitwiseNot $node): int | string |
|
354 | 354 | { |
355 | 355 | return ~$this->resolve($node->expr); |
356 | 356 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node): string |
384 | 384 | { |
385 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
385 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | protected function resolveExprTernary(Expr\Ternary $node) |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | { |
468 | 468 | $nodeType = $node->getType(); |
469 | 469 | |
470 | - return 'resolve' . str_replace('_', '', $nodeType); |
|
470 | + return 'resolve'.str_replace('_', '', $nodeType); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
@@ -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 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | /** |
111 | 111 | * {@inheritDoc} |
112 | 112 | */ |
113 | - public function getDeclaringClass(): \ReflectionClass|ReflectionClass |
|
113 | + public function getDeclaringClass(): \ReflectionClass | ReflectionClass |
|
114 | 114 | { |
115 | 115 | return new ReflectionClass($this->className); |
116 | 116 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | /** |
119 | 119 | * {@inheritDoc} |
120 | 120 | */ |
121 | - public function getDocComment(): bool|string |
|
121 | + public function getDocComment(): bool | string |
|
122 | 122 | { |
123 | 123 | $docBlock = $this->propertyTypeNode->getDocComment(); |
124 | 124 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * @param ?ClassLike $classLikeNode AST node for class |
36 | 36 | * |
37 | 37 | * @noinspection PhpMissingParentConstructorInspection*/ |
38 | - public function __construct(object|string $argument, ClassLike $classLikeNode = null) |
|
38 | + public function __construct(object | string $argument, ClassLike $classLikeNode = null) |
|
39 | 39 | { |
40 | 40 | $fullClassName = is_object($argument) ? get_class($argument) : ltrim($argument, '\\'); |
41 | 41 | $namespaceParts = explode('\\', $fullClassName); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @noinspection PhpUnusedParameterInspection |
84 | 84 | */ |
85 | 85 | public function __construct( |
86 | - string|array $unusedFunctionName, |
|
86 | + string | array $unusedFunctionName, |
|
87 | 87 | string $parameterName, |
88 | 88 | Param $parameterNode = null, |
89 | 89 | int $parameterIndex = 0, |
@@ -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 | |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | /** @noinspection PhpUnhandledExceptionInspection */ |
149 | 149 | $defaultValue = $this->getDefaultValue(); |
150 | 150 | if (is_string($defaultValue) && strlen($defaultValue) > 15) { |
151 | - $defaultValue = substr($defaultValue, 0, 15) . '...'; |
|
151 | + $defaultValue = substr($defaultValue, 0, 15).'...'; |
|
152 | 152 | } |
153 | 153 | /* @see https://3v4l.org/DJOEb for behaviour changes */ |
154 | 154 | if (is_float($defaultValue) && fmod($defaultValue, 1.0) === 0.0) { |
155 | - $defaultValue = (int)$defaultValue; |
|
155 | + $defaultValue = (int) $defaultValue; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $defaultValue = str_replace('\\\\', '\\', var_export($defaultValue, true)); |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | 'Parameter #%d [ %s %s%s%s$%s%s ]', |
163 | 163 | $this->parameterIndex, |
164 | 164 | $isOptional ? '<optional>' : '<required>', |
165 | - $parameterType ? ReflectionType::convertToDisplayType($parameterType) . ' ' : '', |
|
165 | + $parameterType ? ReflectionType::convertToDisplayType($parameterType).' ' : '', |
|
166 | 166 | $this->isVariadic() ? '...' : '', |
167 | 167 | $this->isPassedByReference() ? '&' : '', |
168 | 168 | $this->getName(), |
169 | - ($isOptional && $hasDefaultValue) ? (' = ' . $defaultValue) : '' |
|
169 | + ($isOptional && $hasDefaultValue) ? (' = '.$defaultValue) : '' |
|
170 | 170 | ); |
171 | 171 | } |
172 | 172 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | /** |
200 | 200 | * {@inheritDoc} |
201 | 201 | */ |
202 | - public function getClass(): BaseReflectionClass|null |
|
202 | + public function getClass(): BaseReflectionClass | null |
|
203 | 203 | { |
204 | 204 | $parameterType = $this->parameterNode->type; |
205 | 205 | if ($parameterType instanceof Name) { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public function getName(): string |
278 | 278 | { |
279 | - return (string)$this->parameterNode->var->name; |
|
279 | + return (string) $this->parameterNode->var->name; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | /** |
291 | 291 | * {@inheritDoc} |
292 | 292 | */ |
293 | - public function getType(): \ReflectionType|ReflectionNamedType|null |
|
293 | + public function getType(): \ReflectionType | ReflectionNamedType | null |
|
294 | 294 | { |
295 | 295 | $isBuiltin = false; |
296 | 296 | $parameterType = $this->parameterNode->type; |
@@ -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 | } |