@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | $isRelative = !$pathScheme && ($path[0] !== '/') && ($path[1] !== ':'); |
52 | 52 | if ($isRelative) { |
53 | - $path = getcwd() . DIRECTORY_SEPARATOR . $path; |
|
53 | + $path = getcwd().DIRECTORY_SEPARATOR.$path; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // resolve path parts (single dot, double dot and double delimiters) |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $comments = $this->namespaceNode->getAttribute('comments'); |
183 | 183 | |
184 | 184 | if ($comments) { |
185 | - $docComment = (string)$comments[0]; |
|
185 | + $docComment = (string) $comments[0]; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $docComment; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
356 | 356 | if ($namespaceLevelNode instanceof ClassLike) { |
357 | 357 | $classShortName = $namespaceLevelNode->name->toString(); |
358 | - $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName; |
|
358 | + $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName; |
|
359 | 359 | |
360 | 360 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
361 | 361 | $classes[$className] = new ReflectionClass($className, $namespaceLevelNode); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
380 | 380 | if ($namespaceLevelNode instanceof Function_) { |
381 | 381 | $funcShortName = $namespaceLevelNode->name->toString(); |
382 | - $functionName = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName; |
|
382 | + $functionName = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName; |
|
383 | 383 | |
384 | 384 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
385 | 385 | $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | if ($namespaceLevelNode instanceof Expression |
420 | 420 | && $namespaceLevelNode->expr instanceof FuncCall |
421 | 421 | && $namespaceLevelNode->expr->name instanceof Name |
422 | - && (string)$namespaceLevelNode->expr->name === 'define' |
|
422 | + && (string) $namespaceLevelNode->expr->name === 'define' |
|
423 | 423 | ) { |
424 | 424 | $functionCallNode = $namespaceLevelNode->expr; |
425 | 425 | $expressionSolver->process($functionCallNode->args[0]->value); |
@@ -108,12 +108,12 @@ |
||
108 | 108 | $paramString = ''; |
109 | 109 | $indentation = str_repeat(' ', 4); |
110 | 110 | foreach ($methodParameters as $methodParameter) { |
111 | - $paramString .= "\n{$indentation}" . $methodParameter; |
|
111 | + $paramString .= "\n{$indentation}".$methodParameter; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | return sprintf( |
115 | 115 | "%sMethod [ <user%s%s%s>%s%s%s %s method %s ] {\n @@ %s %d - %d{$paramFormat}{$returnFormat}\n}\n", |
116 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
116 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
117 | 117 | $prototype ? ", overwrites {$prototypeClass}, prototype {$prototypeClass}" : '', |
118 | 118 | $this->isConstructor() ? ', ctor' : '', |
119 | 119 | $this->isDestructor() ? ', dtor' : '', |
@@ -504,7 +504,7 @@ |
||
504 | 504 | |
505 | 505 | if (method_exists($this->context, 'getDeclaringClass')) { |
506 | 506 | return $this->context->getDeclaringClass() |
507 | - ->getParentClass() |
|
507 | + ->getParentClass() |
|
508 | 508 | ; |
509 | 509 | } |
510 | 510 | } |
@@ -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 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName); |
242 | 242 | if ($fileNamespace->hasConstant($constantName)) { |
243 | 243 | $constantValue = $fileNamespace->getConstant($constantName); |
244 | - $constantName = $fileNamespace->getName() . '\\' . $constantName; |
|
244 | + $constantName = $fileNamespace->getName().'\\'.$constantName; |
|
245 | 245 | $isResolved = true; |
246 | 246 | } |
247 | 247 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $reason = 'Unable'; |
268 | 268 | if ($classToReflect instanceof Expr) { |
269 | 269 | $methodName = $this->getDispatchMethodFor($classToReflect); |
270 | - $reason = "Method " . __CLASS__ . "::{$methodName}() not found trying"; |
|
270 | + $reason = "Method ".__CLASS__."::{$methodName}() not found trying"; |
|
271 | 271 | } |
272 | 272 | throw new ReflectionException("$reason to resolve class constant."); |
273 | 273 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | $this->isConstant = true; |
287 | - $this->constantName = $classToReflect . '::' . $constantName; |
|
287 | + $this->constantName = $classToReflect.'::'.$constantName; |
|
288 | 288 | |
289 | 289 | return $refClass->getConstant($constantName); |
290 | 290 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node): string |
370 | 370 | { |
371 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
371 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | protected function resolveExprTernary(Expr\Ternary $node) |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | { |
454 | 454 | $nodeType = $node->getType(); |
455 | 455 | |
456 | - return 'resolve' . str_replace('_', '', $nodeType); |
|
456 | + return 'resolve'.str_replace('_', '', $nodeType); |
|
457 | 457 | } |
458 | 458 | |
459 | 459 | /** |
@@ -87,7 +87,7 @@ |
||
87 | 87 | if ($type instanceof ReflectionNamedType) { |
88 | 88 | $displayType = $type->getName(); |
89 | 89 | } else { |
90 | - $displayType = (string)$type; |
|
90 | + $displayType = (string) $type; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $displayType = ltrim($displayType, '\\'); |
@@ -117,14 +117,14 @@ |
||
117 | 117 | |
118 | 118 | return sprintf( |
119 | 119 | $reflectionFormat, |
120 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
120 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
121 | 121 | $this->getName(), |
122 | 122 | $this->getFileName(), |
123 | 123 | $this->getStartLine(), |
124 | 124 | $this->getEndLine(), |
125 | 125 | count($this->getParameters()), |
126 | - array_reduce($this->getParameters(), static function ($str, ReflectionParameter $param) { |
|
127 | - return $str . "\n " . $param; |
|
126 | + array_reduce($this->getParameters(), static function($str, ReflectionParameter $param) { |
|
127 | + return $str."\n ".$param; |
|
128 | 128 | }, '') |
129 | 129 | ); |
130 | 130 | } |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | return parent::getClosureThis(); |
71 | 71 | } |
72 | 72 | |
73 | - public function getDocComment(): string|false |
|
73 | + public function getDocComment(): string | false |
|
74 | 74 | { |
75 | 75 | $docComment = $this->functionLikeNode->getDocComment(); |
76 | 76 | |
77 | 77 | return $docComment ? $docComment->getText() : false; |
78 | 78 | } |
79 | 79 | |
80 | - public function getEndLine(): int|false |
|
80 | + public function getEndLine(): int | false |
|
81 | 81 | { |
82 | 82 | return $this->functionLikeNode->getAttribute('endLine'); |
83 | 83 | } |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | return null; |
88 | 88 | } |
89 | 89 | |
90 | - public function getExtensionName(): string|false |
|
90 | + public function getExtensionName(): string | false |
|
91 | 91 | { |
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | |
95 | - public function getFileName(): string|false |
|
95 | + public function getFileName(): string | false |
|
96 | 96 | { |
97 | 97 | return $this->functionLikeNode->getAttribute('fileName'); |
98 | 98 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) { |
106 | 106 | $functionName = $this->functionLikeNode->name->toString(); |
107 | 107 | |
108 | - return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName; |
|
108 | + return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | return false; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | foreach ($this->functionLikeNode->getParams() as $parameterIndex => $parameterNode) { |
162 | 162 | $reflectionParameter = new ReflectionParameter( |
163 | 163 | $this->getName(), |
164 | - (string)$parameterNode->var->name, |
|
164 | + (string) $parameterNode->var->name, |
|
165 | 165 | $parameterNode, |
166 | 166 | $parameterIndex, |
167 | 167 | $this |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | return false; |
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 | } |
@@ -146,19 +146,19 @@ discard block |
||
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
149 | - $buildString = static function (array $items, $indentLevel = 4) { |
|
149 | + $buildString = static function(array $items, $indentLevel = 4) { |
|
150 | 150 | if (!count($items)) { |
151 | 151 | return ''; |
152 | 152 | } |
153 | - $indent = "\n" . str_repeat(' ', $indentLevel); |
|
153 | + $indent = "\n".str_repeat(' ', $indentLevel); |
|
154 | 154 | |
155 | - return $indent . implode($indent, explode("\n", implode("\n", $items))); |
|
155 | + return $indent.implode($indent, explode("\n", implode("\n", $items))); |
|
156 | 156 | }; |
157 | 157 | |
158 | - $buildConstants = static function (array $items, $indentLevel = 4) { |
|
158 | + $buildConstants = static function(array $items, $indentLevel = 4) { |
|
159 | 159 | $str = ''; |
160 | 160 | foreach ($items as $name => $value) { |
161 | - $str .= "\n" . str_repeat(' ', $indentLevel); |
|
161 | + $str .= "\n".str_repeat(' ', $indentLevel); |
|
162 | 162 | $str .= sprintf( |
163 | 163 | 'Constant [ %s %s ] { %s }', |
164 | 164 | gettype($value), |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | ($isObject ? 'Object of class' : 'Class'), |
184 | 184 | $modifiers, |
185 | 185 | $this->getName(), |
186 | - false !== $parentClass ? (' extends ' . $parentClass->getName()) : '', |
|
187 | - $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '', |
|
186 | + false !== $parentClass ? (' extends '.$parentClass->getName()) : '', |
|
187 | + $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '', |
|
188 | 188 | $this->getFileName(), |
189 | 189 | $this->getStartLine(), |
190 | 190 | $this->getEndLine(), |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | { |
226 | 226 | if (!isset($this->constants)) { |
227 | 227 | $this->constants = $this->recursiveCollect( |
228 | - function (array &$result, \ReflectionClass $instance) { |
|
228 | + function(array &$result, \ReflectionClass $instance) { |
|
229 | 229 | $result += $instance->getConstants(); |
230 | 230 | } |
231 | 231 | ); |
@@ -289,14 +289,14 @@ discard block |
||
289 | 289 | /** |
290 | 290 | * {@inheritDoc} |
291 | 291 | */ |
292 | - public function getDocComment(): string|false |
|
292 | + public function getDocComment(): string | false |
|
293 | 293 | { |
294 | 294 | $docComment = $this->classLikeNode->getDocComment(); |
295 | 295 | |
296 | 296 | return $docComment ? $docComment->getText() : false; |
297 | 297 | } |
298 | 298 | |
299 | - public function getEndLine(): int|false |
|
299 | + public function getEndLine(): int | false |
|
300 | 300 | { |
301 | 301 | return $this->classLikeNode->getAttribute('endLine'); |
302 | 302 | } |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | return null; |
307 | 307 | } |
308 | 308 | |
309 | - public function getExtensionName(): string|false |
|
309 | + public function getExtensionName(): string | false |
|
310 | 310 | { |
311 | 311 | return false; |
312 | 312 | } |
313 | 313 | |
314 | - public function getFileName(): string|false |
|
314 | + public function getFileName(): string | false |
|
315 | 315 | { |
316 | 316 | return $this->classLikeNode->getAttribute('fileName'); |
317 | 317 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | { |
332 | 332 | if (!isset($this->interfaceClasses)) { |
333 | 333 | $this->interfaceClasses = $this->recursiveCollect( |
334 | - function (array &$result, \ReflectionClass $instance) { |
|
334 | + function(array &$result, \ReflectionClass $instance) { |
|
335 | 335 | if ($instance->isInterface()) { |
336 | 336 | $result[$instance->name] = $instance; |
337 | 337 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if (!isset($this->methods)) { |
372 | 372 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); |
373 | 373 | $parentMethods = $this->recursiveCollect( |
374 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
374 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
375 | 375 | $reflectionMethods = []; |
376 | 376 | foreach ($instance->getMethods() as $reflectionMethod) { |
377 | 377 | if (!$isParent || !$reflectionMethod->isPrivate()) { |
@@ -442,9 +442,9 @@ discard block |
||
442 | 442 | */ |
443 | 443 | public function getName(): string |
444 | 444 | { |
445 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
445 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
446 | 446 | |
447 | - return $namespaceName . $this->getShortName(); |
|
447 | + return $namespaceName.$this->getShortName(); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | /** |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | /** |
459 | 459 | * {@inheritDoc} |
460 | 460 | */ |
461 | - public function getParentClass(): \ReflectionClass|false |
|
461 | + public function getParentClass(): \ReflectionClass | false |
|
462 | 462 | { |
463 | 463 | if (!isset($this->parentClass)) { |
464 | 464 | static $extendsField = 'extends'; |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | if (!isset($this->properties)) { |
490 | 490 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
491 | 491 | $parentProperties = $this->recursiveCollect( |
492 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
492 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
493 | 493 | $reflectionProperties = []; |
494 | 494 | foreach ($instance->getProperties() as $reflectionProperty) { |
495 | 495 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | /** |
539 | 539 | * @inheritDoc |
540 | 540 | */ |
541 | - public function getReflectionConstant(string $name): ReflectionClassConstant|false |
|
541 | + public function getReflectionConstant(string $name): ReflectionClassConstant | false |
|
542 | 542 | { |
543 | 543 | $classConstants = $this->getReflectionConstants(); |
544 | 544 | foreach ($classConstants as $classConstant) { |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | $this->getName() |
562 | 562 | ); |
563 | 563 | $parentClassConstants = $this->recursiveCollect( |
564 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
564 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
565 | 565 | $reflectionClassConstants = []; |
566 | 566 | foreach ($instance->getReflectionConstants() as $reflectionClassConstant) { |
567 | 567 | if (!$isParent || !$reflectionClassConstant->isPrivate()) { |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | return $this->className; |
588 | 588 | } |
589 | 589 | |
590 | - public function getStartLine(): int|false |
|
590 | + public function getStartLine(): int | false |
|
591 | 591 | { |
592 | 592 | return $this->classLikeNode->getAttribute('startLine'); |
593 | 593 | } |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | break; |
615 | 615 | } |
616 | 616 | } |
617 | - $aliases[$adaptation->newName] = $traitName . '::' . $methodName; |
|
617 | + $aliases[$adaptation->newName] = $traitName.'::'.$methodName; |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | * {@inheritDoc} |
701 | 701 | * @param string $interfaceName |
702 | 702 | */ |
703 | - public function implementsInterface(\ReflectionClass|string $interfaceName): bool |
|
703 | + public function implementsInterface(\ReflectionClass | string $interfaceName): bool |
|
704 | 704 | { |
705 | 705 | $allInterfaces = $this->getInterfaces(); |
706 | 706 | |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | /** |
826 | 826 | * {@inheritDoc} |
827 | 827 | */ |
828 | - public function isSubclassOf(\ReflectionClass|string $class): bool |
|
828 | + public function isSubclassOf(\ReflectionClass | string $class): bool |
|
829 | 829 | { |
830 | 830 | if (is_object($class)) { |
831 | 831 | if ($class instanceof ReflectionClass) { |
@@ -119,7 +119,7 @@ |
||
119 | 119 | /** |
120 | 120 | * @inheritDoc |
121 | 121 | */ |
122 | - public function getDocComment(): string|false |
|
122 | + public function getDocComment(): string | false |
|
123 | 123 | { |
124 | 124 | $docBlock = $this->classConstantNode->getDocComment(); |
125 | 125 |