@@ -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); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) { |
| 103 | 103 | $functionName = $this->functionLikeNode->name->toString(); |
| 104 | 104 | |
| 105 | - return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName; |
|
| 105 | + return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return false; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | foreach ($this->functionLikeNode->getParams() as $parameterIndex => $parameterNode) { |
| 159 | 159 | $reflectionParameter = new ReflectionParameter( |
| 160 | 160 | $this->getName(), |
| 161 | - (string)$parameterNode->var->name, |
|
| 161 | + (string) $parameterNode->var->name, |
|
| 162 | 162 | $parameterNode, |
| 163 | 163 | $parameterIndex, |
| 164 | 164 | $this |
@@ -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 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function __debugInfo(): array |
| 124 | 124 | { |
| 125 | 125 | return [ |
| 126 | - 'name' => (string)$this->parameterNode->var->name, |
|
| 126 | + 'name' => (string) $this->parameterNode->var->name, |
|
| 127 | 127 | ]; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | if ($hasDefaultValue) { |
| 142 | 142 | $defaultValue = $this->getDefaultValue(); |
| 143 | 143 | if (is_string($defaultValue) && strlen($defaultValue) > 15) { |
| 144 | - $defaultValue = substr($defaultValue, 0, 15) . '...'; |
|
| 144 | + $defaultValue = substr($defaultValue, 0, 15).'...'; |
|
| 145 | 145 | } |
| 146 | 146 | /* @see https://3v4l.org/DJOEb for behaviour changes */ |
| 147 | 147 | if (is_float($defaultValue) && fmod($defaultValue, 1.0) === 0.0) { |
| 148 | - $defaultValue = (int)$defaultValue; |
|
| 148 | + $defaultValue = (int) $defaultValue; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $defaultValue = str_replace('\\\\', '\\', var_export($defaultValue, true)); |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | 'Parameter #%d [ %s %s%s%s$%s%s ]', |
| 156 | 156 | $this->parameterIndex, |
| 157 | 157 | $isOptional ? '<optional>' : '<required>', |
| 158 | - $parameterType ? ReflectionType::convertToDisplayType($parameterType) . ' ' : '', |
|
| 158 | + $parameterType ? ReflectionType::convertToDisplayType($parameterType).' ' : '', |
|
| 159 | 159 | $this->isVariadic() ? '...' : '', |
| 160 | 160 | $this->isPassedByReference() ? '&' : '', |
| 161 | 161 | $this->getName(), |
| 162 | - ($isOptional && $hasDefaultValue) ? (' = ' . $defaultValue) : '' |
|
| 162 | + ($isOptional && $hasDefaultValue) ? (' = '.$defaultValue) : '' |
|
| 163 | 163 | ); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public function getName() |
| 270 | 270 | { |
| 271 | - return (string)$this->parameterNode->var->name; |
|
| 271 | + return (string) $this->parameterNode->var->name; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
@@ -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 | } |
@@ -147,19 +147,19 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $buildString = static function (array $items, $indentLevel = 4) { |
|
| 150 | + $buildString = static function(array $items, $indentLevel = 4) { |
|
| 151 | 151 | if (!count($items)) { |
| 152 | 152 | return ''; |
| 153 | 153 | } |
| 154 | - $indent = "\n" . str_repeat(' ', $indentLevel); |
|
| 154 | + $indent = "\n".str_repeat(' ', $indentLevel); |
|
| 155 | 155 | |
| 156 | - return $indent . implode($indent, explode("\n", implode("\n", $items))); |
|
| 156 | + return $indent.implode($indent, explode("\n", implode("\n", $items))); |
|
| 157 | 157 | }; |
| 158 | 158 | |
| 159 | - $buildConstants = static function (array $items, $indentLevel = 4) { |
|
| 159 | + $buildConstants = static function(array $items, $indentLevel = 4) { |
|
| 160 | 160 | $str = ''; |
| 161 | 161 | foreach ($items as $name => $value) { |
| 162 | - $str .= "\n" . str_repeat(' ', $indentLevel); |
|
| 162 | + $str .= "\n".str_repeat(' ', $indentLevel); |
|
| 163 | 163 | $str .= sprintf( |
| 164 | 164 | 'Constant [ %s %s ] { %s }', |
| 165 | 165 | gettype($value), |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | ($isObject ? 'Object of class' : 'Class'), |
| 185 | 185 | $modifiers, |
| 186 | 186 | $this->getName(), |
| 187 | - false !== $parentClass ? (' extends ' . $parentClass->getName()) : '', |
|
| 188 | - $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '', |
|
| 187 | + false !== $parentClass ? (' extends '.$parentClass->getName()) : '', |
|
| 188 | + $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '', |
|
| 189 | 189 | $this->getFileName(), |
| 190 | 190 | $this->getStartLine(), |
| 191 | 191 | $this->getEndLine(), |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | if (!isset($this->constants)) { |
| 229 | 229 | $this->constants = $this->recursiveCollect( |
| 230 | - function (array &$result, \ReflectionClass $instance) { |
|
| 230 | + function(array &$result, \ReflectionClass $instance) { |
|
| 231 | 231 | $result += $instance->getConstants(); |
| 232 | 232 | } |
| 233 | 233 | ); |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | { |
| 337 | 337 | if (!isset($this->interfaceClasses)) { |
| 338 | 338 | $this->interfaceClasses = $this->recursiveCollect( |
| 339 | - function (array &$result, \ReflectionClass $instance) { |
|
| 339 | + function(array &$result, \ReflectionClass $instance) { |
|
| 340 | 340 | if ($instance->isInterface()) { |
| 341 | 341 | $result[$instance->name] = $instance; |
| 342 | 342 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if (!isset($this->methods)) { |
| 378 | 378 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); |
| 379 | 379 | $parentMethods = $this->recursiveCollect( |
| 380 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 380 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 381 | 381 | $reflectionMethods = []; |
| 382 | 382 | foreach ($instance->getMethods() as $reflectionMethod) { |
| 383 | 383 | if (!$isParent || !$reflectionMethod->isPrivate()) { |
@@ -448,9 +448,9 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function getName(): string |
| 450 | 450 | { |
| 451 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
| 451 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
| 452 | 452 | |
| 453 | - return $namespaceName . $this->getShortName(); |
|
| 453 | + return $namespaceName.$this->getShortName(); |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | /** |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | if (!isset($this->properties)) { |
| 498 | 498 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
| 499 | 499 | $parentProperties = $this->recursiveCollect( |
| 500 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 500 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 501 | 501 | $reflectionProperties = []; |
| 502 | 502 | foreach ($instance->getProperties() as $reflectionProperty) { |
| 503 | 503 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | $this->getName() |
| 572 | 572 | ); |
| 573 | 573 | $parentClassConstants = $this->recursiveCollect( |
| 574 | - function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 574 | + function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 575 | 575 | $reflectionClassConstants = []; |
| 576 | 576 | foreach ($instance->getReflectionConstants() as $reflectionClassConstant) { |
| 577 | 577 | if (!$isParent || !$reflectionClassConstant->isPrivate()) { |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | break; |
| 626 | 626 | } |
| 627 | 627 | } |
| 628 | - $aliases[$adaptation->newName] = $traitName . '::' . $methodName; |
|
| 628 | + $aliases[$adaptation->newName] = $traitName.'::'.$methodName; |
|
| 629 | 629 | } |
| 630 | 630 | } |
| 631 | 631 | |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | // } |
| 120 | 120 | |
| 121 | 121 | /** @noinspection PhpFormatFunctionParametersMismatchInspection */ |
| 122 | - return sprintf( |
|
| 122 | + return sprintf( |
|
| 123 | 123 | "%sMethod [ <user%s%s%s%s>%s%s%s %s method %s ] {\n @@ %s %d - %d$paramFormat$returnFormat\n}\n", |
| 124 | 124 | $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
| 125 | 125 | $inheritance, |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $paramString = ''; |
| 110 | 110 | $indentation = str_repeat(' ', 4); |
| 111 | 111 | foreach ($methodParameters as $methodParameter) { |
| 112 | - $paramString .= "\n$indentation" . $methodParameter; |
|
| 112 | + $paramString .= "\n$indentation".$methodParameter; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | $inheritance = ''; // todo: this method does not get loaded because somewhere it grabs the wrong Reflection methods |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | /** @noinspection PhpFormatFunctionParametersMismatchInspection */ |
| 122 | 122 | return sprintf( |
| 123 | 123 | "%sMethod [ <user%s%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 | $inheritance, |
| 126 | 126 | $prototype ? ", overwrites $prototypeClass, prototype $prototypeClass" : '', |
| 127 | 127 | $this->isConstructor() ? ', ctor' : '', |