@@ -58,7 +58,7 @@ |
||
| 58 | 58 | Property $propertyType = null, |
| 59 | 59 | PropertyProperty $propertyNode = null) |
| 60 | 60 | { |
| 61 | - $this->className = $className; |
|
| 61 | + $this->className = $className; |
|
| 62 | 62 | if (!$propertyType || !$propertyNode) { |
| 63 | 63 | list ($propertyType, $propertyNode) = ReflectionEngine::parseClassProperty($className, $propertyName); |
| 64 | 64 | } |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | namespace Go\ParserReflection; |
| 12 | 12 | |
| 13 | 13 | use Go\ParserReflection\Traits\ReflectionClassLikeTrait; |
| 14 | -use PhpParser\Node\Name; |
|
| 15 | 14 | use PhpParser\Node\Stmt\ClassLike; |
| 16 | 15 | use ReflectionObject as InternalReflectionObject; |
| 17 | 16 | |
@@ -106,14 +106,14 @@ |
||
| 106 | 106 | |
| 107 | 107 | return sprintf( |
| 108 | 108 | $reflectionFormat, |
| 109 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
| 109 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
| 110 | 110 | $this->getName(), |
| 111 | 111 | $this->getFileName(), |
| 112 | 112 | $this->getStartLine(), |
| 113 | 113 | $this->getEndLine(), |
| 114 | 114 | count($this->getParameters()), |
| 115 | - array_reduce($this->getParameters(), function ($str, ReflectionParameter $param) { |
|
| 116 | - return $str . "\n " . $param; |
|
| 115 | + array_reduce($this->getParameters(), function($str, ReflectionParameter $param) { |
|
| 116 | + return $str."\n ".$param; |
|
| 117 | 117 | }, '') |
| 118 | 118 | ); |
| 119 | 119 | } |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) { |
| 102 | 102 | $functionName = $this->functionLikeNode->name; |
| 103 | 103 | |
| 104 | - return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName; |
|
| 104 | + return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return false; |
@@ -92,12 +92,12 @@ |
||
| 92 | 92 | $paramString = ''; |
| 93 | 93 | $identation = str_repeat(' ', 4); |
| 94 | 94 | foreach ($methodParameters as $methodParameter) { |
| 95 | - $paramString .= "\n{$identation}" . $methodParameter; |
|
| 95 | + $paramString .= "\n{$identation}".$methodParameter; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return sprintf( |
| 99 | 99 | "%sMethod [ <user%s%s%s>%s%s%s %s method %s ] {\n @@ %s %d - %d{$paramFormat}\n}\n", |
| 100 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
| 100 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
| 101 | 101 | $prototype ? ", overwrites {$prototypeClass}, prototype {$prototypeClass}" : '', |
| 102 | 102 | $this->isConstructor() ? ', ctor' : '', |
| 103 | 103 | $this->isDestructor() ? ', dtor' : '', |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | if ($isOptional) { |
| 131 | 131 | $defaultValue = $this->getDefaultValue(); |
| 132 | 132 | if (is_string($defaultValue) && strlen($defaultValue) > 15) { |
| 133 | - $defaultValue = substr($defaultValue, 0, 15) . '...'; |
|
| 133 | + $defaultValue = substr($defaultValue, 0, 15).'...'; |
|
| 134 | 134 | } |
| 135 | 135 | /* @see https://3v4l.org/DJOEb for behaviour changes */ |
| 136 | 136 | if (is_double($defaultValue) && fmod($defaultValue, 1.0) === 0.0) { |
@@ -143,12 +143,12 @@ discard block |
||
| 143 | 143 | 'Parameter #%d [ %s %s%s%s%s$%s%s ]', |
| 144 | 144 | $this->parameterIndex, |
| 145 | 145 | ($this->isVariadic() || $isOptional) ? '<optional>' : '<required>', |
| 146 | - $parameterType ? ltrim($parameterType, '\\') . ' ' : '', |
|
| 146 | + $parameterType ? ltrim($parameterType, '\\').' ' : '', |
|
| 147 | 147 | $isNullableParam ? 'or NULL ' : '', |
| 148 | 148 | $this->isVariadic() ? '...' : '', |
| 149 | 149 | $this->isPassedByReference() ? '&' : '', |
| 150 | 150 | $this->getName(), |
| 151 | - $isOptional ? (' = ' . $defaultValue) : '' |
|
| 151 | + $isOptional ? (' = '.$defaultValue) : '' |
|
| 152 | 152 | ); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if (!$parameterType instanceof Name\FullyQualified) { |
| 184 | 184 | throw new ReflectionException("Can not resolve a class name for parameter"); |
| 185 | 185 | } |
| 186 | - $className = $parameterType->toString(); |
|
| 186 | + $className = $parameterType->toString(); |
|
| 187 | 187 | $classOrInterfaceExists = class_exists($className, false) || interface_exists($className, false); |
| 188 | 188 | |
| 189 | 189 | return $classOrInterfaceExists ? new \ReflectionClass($className) : new ReflectionClass($className); |
@@ -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) |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | ++$this->nodeLevel; |
| 114 | 114 | |
| 115 | 115 | $nodeType = $node->getType(); |
| 116 | - $methodName = 'resolve' . str_replace('_', '', $nodeType); |
|
| 116 | + $methodName = 'resolve'.str_replace('_', '', $nodeType); |
|
| 117 | 117 | if (method_exists($this, $methodName)) { |
| 118 | 118 | $value = $this->$methodName($node); |
| 119 | 119 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | protected function resolveScalarMagicConstMethod() |
| 143 | 143 | { |
| 144 | 144 | if ($this->context instanceof \ReflectionMethod) { |
| 145 | - $fullName = $this->context->getDeclaringClass()->getName() . '::' . $this->context->getShortName(); |
|
| 145 | + $fullName = $this->context->getDeclaringClass()->getName().'::'.$this->context->getShortName(); |
|
| 146 | 146 | |
| 147 | 147 | return $fullName; |
| 148 | 148 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName); |
| 237 | 237 | if ($fileNamespace->hasConstant($constantName)) { |
| 238 | 238 | $constantValue = $fileNamespace->getConstant($constantName); |
| 239 | - $constantName = $fileNamespace->getName() . '\\' . $constantName; |
|
| 239 | + $constantName = $fileNamespace->getName().'\\'.$constantName; |
|
| 240 | 240 | $isResolved = true; |
| 241 | 241 | } |
| 242 | 242 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | $this->isConstant = true; |
| 268 | - $this->constantName = (string)$node->class . '::' . $constantName; |
|
| 268 | + $this->constantName = (string) $node->class.'::'.$constantName; |
|
| 269 | 269 | |
| 270 | 270 | return $refClass->getConstant($constantName); |
| 271 | 271 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node) |
| 346 | 346 | { |
| 347 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
| 347 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | protected function resolveExprTernary(Expr\Ternary $node) |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 320 | 320 | if ($namespaceLevelNode instanceof ClassLike) { |
| 321 | 321 | $classShortName = $namespaceLevelNode->name; |
| 322 | - $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName; |
|
| 322 | + $className = $namespaceName ? $namespaceName.'\\'.$classShortName : $classShortName; |
|
| 323 | 323 | |
| 324 | 324 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 325 | 325 | $classes[$className] = new ReflectionClass($className, $namespaceLevelNode); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 344 | 344 | if ($namespaceLevelNode instanceof Function_) { |
| 345 | 345 | $funcShortName = $namespaceLevelNode->name; |
| 346 | - $functionName = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName; |
|
| 346 | + $functionName = $namespaceName ? $namespaceName.'\\'.$funcShortName : $funcShortName; |
|
| 347 | 347 | |
| 348 | 348 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 349 | 349 | $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 383 | 383 | if ($namespaceLevelNode instanceof FuncCall |
| 384 | 384 | && $namespaceLevelNode->name instanceof Name |
| 385 | - && (string)$namespaceLevelNode->name === 'define' |
|
| 385 | + && (string) $namespaceLevelNode->name === 'define' |
|
| 386 | 386 | ) { |
| 387 | 387 | $expressionSolver->process($namespaceLevelNode->args[0]->value); |
| 388 | 388 | $constantName = $expressionSolver->getValue(); |