@@ -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; |
@@ -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 |
@@ -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 | /** |
@@ -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 | } |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function getConstants( |
227 | 227 | ?int $filter = ReflectionClassConstant::IS_PUBLIC |
228 | - |ReflectionClassConstant::IS_PROTECTED |
|
229 | - |ReflectionClassConstant::IS_PRIVATE |
|
228 | + |ReflectionClassConstant::IS_PROTECTED |
|
229 | + |ReflectionClassConstant::IS_PRIVATE |
|
230 | 230 | ): array { |
231 | 231 | if (!isset($this->constants)) { |
232 | 232 | $this->constants = $this->recursiveCollect( |
@@ -566,8 +566,8 @@ discard block |
||
566 | 566 | */ |
567 | 567 | public function getReflectionConstants( |
568 | 568 | ?int $filter = ReflectionClassConstant::IS_PUBLIC |
569 | - |ReflectionClassConstant::IS_PROTECTED |
|
570 | - |ReflectionClassConstant::IS_PRIVATE |
|
569 | + |ReflectionClassConstant::IS_PROTECTED |
|
570 | + |ReflectionClassConstant::IS_PRIVATE |
|
571 | 571 | ): array { |
572 | 572 | if (!isset($this->classConstants)) { |
573 | 573 | $directClassConstants = ReflectionClassConstant::collectFromClassNode( |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * |
108 | 108 | * @var BaseReflectionClass|false|null |
109 | 109 | */ |
110 | - protected null|BaseReflectionClass|false $parentClass; |
|
110 | + protected null | BaseReflectionClass | false $parentClass; |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * @var ReflectionProperty[]|null |
@@ -160,19 +160,19 @@ discard block |
||
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | - $buildString = static function (array $items, $indentLevel = 4) { |
|
163 | + $buildString = static function(array $items, $indentLevel = 4) { |
|
164 | 164 | if (!count($items)) { |
165 | 165 | return ''; |
166 | 166 | } |
167 | - $indent = "\n" . str_repeat(' ', $indentLevel); |
|
167 | + $indent = "\n".str_repeat(' ', $indentLevel); |
|
168 | 168 | |
169 | - return $indent . implode($indent, explode("\n", implode("\n", $items))); |
|
169 | + return $indent.implode($indent, explode("\n", implode("\n", $items))); |
|
170 | 170 | }; |
171 | 171 | |
172 | - $buildConstants = static function (array $items, $indentLevel = 4) { |
|
172 | + $buildConstants = static function(array $items, $indentLevel = 4) { |
|
173 | 173 | $str = ''; |
174 | 174 | foreach ($items as $name => $value) { |
175 | - $str .= "\n" . str_repeat(' ', $indentLevel); |
|
175 | + $str .= "\n".str_repeat(' ', $indentLevel); |
|
176 | 176 | $str .= sprintf( |
177 | 177 | 'Constant [ %s %s ] { %s }', |
178 | 178 | gettype($value), |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | ($isObject ? 'Object of class' : 'Class'), |
198 | 198 | $modifiers, |
199 | 199 | $this->getName(), |
200 | - false !== $parentClass ? (' extends ' . $parentClass->getName()) : '', |
|
201 | - $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '', |
|
200 | + false !== $parentClass ? (' extends '.$parentClass->getName()) : '', |
|
201 | + $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '', |
|
202 | 202 | $this->getFileName(), |
203 | 203 | $this->getStartLine(), |
204 | 204 | $this->getEndLine(), |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | ): array { |
256 | 256 | if (!isset($this->constants)) { |
257 | 257 | $this->constants = $this->recursiveCollect( |
258 | - function (array &$result, BaseReflectionClass $instance) { |
|
258 | + function(array &$result, BaseReflectionClass $instance) { |
|
259 | 259 | $result += $instance->getConstants(); |
260 | 260 | } |
261 | 261 | ); |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | * |
329 | 329 | * @return string|false The doc comment if it exists, otherwise {@see false} |
330 | 330 | */ |
331 | - public function getDocComment(): string|false |
|
331 | + public function getDocComment(): string | false |
|
332 | 332 | { |
333 | 333 | $docComment = $this->classLikeNode->getDocComment(); |
334 | 334 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | * @return int|false The ending line number of the user defined class, or |
344 | 344 | * {@see false} if unknown. |
345 | 345 | */ |
346 | - public function getEndLine(): int|false |
|
346 | + public function getEndLine(): int | false |
|
347 | 347 | { |
348 | 348 | return $this->classLikeNode->getAttribute('endLine'); |
349 | 349 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | * @return string|false The name of the extension which defined the class, |
370 | 370 | * or {@see false} for user-defined classes. |
371 | 371 | */ |
372 | - public function getExtensionName(): string|false |
|
372 | + public function getExtensionName(): string | false |
|
373 | 373 | { |
374 | 374 | return false; |
375 | 375 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * If the class is defined in the PHP core or in a PHP extension, {@see false} |
384 | 384 | * is returned. |
385 | 385 | */ |
386 | - public function getFileName(): string|false |
|
386 | + public function getFileName(): string | false |
|
387 | 387 | { |
388 | 388 | return $this->classLikeNode->getAttribute('fileName'); |
389 | 389 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | { |
413 | 413 | if (!isset($this->interfaceClasses)) { |
414 | 414 | $this->interfaceClasses = $this->recursiveCollect( |
415 | - function (array &$result, BaseReflectionClass $instance) { |
|
415 | + function(array &$result, BaseReflectionClass $instance) { |
|
416 | 416 | if ($instance->isInterface()) { |
417 | 417 | $result[$instance->name] = $instance; |
418 | 418 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | if (!isset($this->methods)) { |
464 | 464 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); |
465 | 465 | $parentMethods = $this->recursiveCollect( |
466 | - function (array &$result, ReflectionClass $instance, $isParent) { |
|
466 | + function(array &$result, ReflectionClass $instance, $isParent) { |
|
467 | 467 | $reflectionMethods = []; |
468 | 468 | foreach ($instance->getMethods() as $reflectionMethod) { |
469 | 469 | if (!$isParent || !$reflectionMethod->isPrivate()) { |
@@ -605,9 +605,9 @@ discard block |
||
605 | 605 | */ |
606 | 606 | public function getName(): string |
607 | 607 | { |
608 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
608 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
609 | 609 | |
610 | - return $namespaceName . $this->getShortName(); |
|
610 | + return $namespaceName.$this->getShortName(); |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | /** |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | * @return ReflectionClass|false A {@see ReflectionClass} or {@see false} |
631 | 631 | * if there's no parent. |
632 | 632 | */ |
633 | - public function getParentClass(): ReflectionClass|false |
|
633 | + public function getParentClass(): ReflectionClass | false |
|
634 | 634 | { |
635 | 635 | if (!isset($this->parentClass)) { |
636 | 636 | static $extendsField = 'extends'; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | if (!isset($this->properties)) { |
668 | 668 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
669 | 669 | $parentProperties = $this->recursiveCollect( |
670 | - function (array &$result, ReflectionClass $instance, $isParent) { |
|
670 | + function(array &$result, ReflectionClass $instance, $isParent) { |
|
671 | 671 | $reflectionProperties = []; |
672 | 672 | foreach ($instance->getProperties() as $reflectionProperty) { |
673 | 673 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | * |
731 | 731 | * @return BaseReflectionClassConstant|false A {@see BaseReflectionClassConstant}. |
732 | 732 | */ |
733 | - public function getReflectionConstant(string $name): BaseReflectionClassConstant|false |
|
733 | + public function getReflectionConstant(string $name): BaseReflectionClassConstant | false |
|
734 | 734 | { |
735 | 735 | $classConstants = $this->getReflectionConstants(); |
736 | 736 | foreach ($classConstants as $classConstant) { |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | $this->getName() |
763 | 763 | ); |
764 | 764 | $parentClassConstants = $this->recursiveCollect( |
765 | - function (array &$result, ReflectionClass $instance, $isParent) { |
|
765 | + function(array &$result, ReflectionClass $instance, $isParent) { |
|
766 | 766 | $reflectionClassConstants = []; |
767 | 767 | foreach ($instance->getReflectionConstants() as $reflectionClassConstant) { |
768 | 768 | if (!$isParent || !$reflectionClassConstant->isPrivate()) { |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | * |
800 | 800 | * @return int|false The starting line number, as an integer. |
801 | 801 | */ |
802 | - public function getStartLine(): int|false |
|
802 | + public function getStartLine(): int | false |
|
803 | 803 | { |
804 | 804 | return $this->classLikeNode->getAttribute('startLine'); |
805 | 805 | } |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | break; |
828 | 828 | } |
829 | 829 | } |
830 | - $aliases[$adaptation->newName->toString()] = $traitName . '::' . $methodName; |
|
830 | + $aliases[$adaptation->newName->toString()] = $traitName.'::'.$methodName; |
|
831 | 831 | } |
832 | 832 | } |
833 | 833 | |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | * |
938 | 938 | * @return bool Returns {@see true} on success or {@see false} on failure. |
939 | 939 | */ |
940 | - public function implementsInterface(BaseReflectionClass|string $interface): bool |
|
940 | + public function implementsInterface(BaseReflectionClass | string $interface): bool |
|
941 | 941 | { |
942 | 942 | $allInterfaces = $this->getInterfaces(); |
943 | 943 | |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | * |
1112 | 1112 | * @return bool {@see true} on success or {@see false} on failure. |
1113 | 1113 | */ |
1114 | - public function isSubclassOf(BaseReflectionClass|string $class): bool |
|
1114 | + public function isSubclassOf(BaseReflectionClass | string $class): bool |
|
1115 | 1115 | { |
1116 | 1116 | if ($class instanceof ReflectionClass) { |
1117 | 1117 | $className = $class->name; |
@@ -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 |