@@ -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 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 288 | 288 | if ($namespaceLevelNode instanceof Class_) { |
| 289 | 289 | $classShortName = $namespaceLevelNode->name; |
| 290 | - $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName; |
|
| 290 | + $className = $namespaceName ? $namespaceName . '\\' . $classShortName : $classShortName; |
|
| 291 | 291 | |
| 292 | 292 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 293 | 293 | $classes[$className] = new ReflectionClass($className, $namespaceLevelNode); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { |
| 312 | 312 | if ($namespaceLevelNode instanceof Function_) { |
| 313 | 313 | $funcShortName = $namespaceLevelNode->name; |
| 314 | - $functionName = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName; |
|
| 314 | + $functionName = $namespaceName ? $namespaceName . '\\' . $funcShortName : $funcShortName; |
|
| 315 | 315 | |
| 316 | 316 | $namespaceLevelNode->setAttribute('fileName', $this->fileName); |
| 317 | 317 | $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode); |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $this->getStartLine(), |
| 112 | 112 | $this->getEndLine(), |
| 113 | 113 | count($this->getParameters()), |
| 114 | - array_reduce($this->getParameters(), function ($str, ReflectionParameter $param) { |
|
| 114 | + array_reduce($this->getParameters(), function($str, ReflectionParameter $param) { |
|
| 115 | 115 | return $str . "\n " . $param; |
| 116 | 116 | }, '') |
| 117 | 117 | ); |
@@ -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 | |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $buildString = function (array $items, $indentLevel = 4) { |
|
| 138 | + $buildString = function(array $items, $indentLevel = 4) { |
|
| 139 | 139 | if (!count($items)) { |
| 140 | 140 | return ''; |
| 141 | 141 | } |
| 142 | 142 | $indent = "\n" . str_repeat(' ', $indentLevel); |
| 143 | 143 | return $indent . implode($indent, explode("\n", implode("\n", $items))); |
| 144 | 144 | }; |
| 145 | - $buildConstants = function (array $items, $indentLevel = 4) { |
|
| 145 | + $buildConstants = function(array $items, $indentLevel = 4) { |
|
| 146 | 146 | $str = ''; |
| 147 | 147 | foreach ($items as $name => $value) { |
| 148 | 148 | $str .= "\n" . str_repeat(' ', $indentLevel); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | { |
| 212 | 212 | if (!isset($this->constants)) { |
| 213 | 213 | $directConstants = $this->findConstants(); |
| 214 | - $parentConstants = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) { |
|
| 214 | + $parentConstants = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) { |
|
| 215 | 215 | $result += $instance->getConstants(); |
| 216 | 216 | }); |
| 217 | 217 | $constants = $directConstants + $parentConstants; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | public function getInterfaces() |
| 278 | 278 | { |
| 279 | 279 | if (!isset($this->interfaceClasses)) { |
| 280 | - $this->interfaceClasses = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) { |
|
| 280 | + $this->interfaceClasses = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) { |
|
| 281 | 281 | if ($instance->isInterface()) { |
| 282 | 282 | $result[$instance->name] = $instance; |
| 283 | 283 | } |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | { |
| 313 | 313 | if (!isset($this->methods)) { |
| 314 | 314 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this->getName()); |
| 315 | - $parentMethods = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) { |
|
| 315 | + $parentMethods = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) { |
|
| 316 | 316 | $result = array_merge($result, $instance->getMethods()); |
| 317 | 317 | }); |
| 318 | 318 | $methods = array_merge($directMethods, $parentMethods); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | { |
| 376 | 376 | if (!isset($this->properties)) { |
| 377 | 377 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
| 378 | - $parentProperties = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) { |
|
| 378 | + $parentProperties = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) { |
|
| 379 | 379 | $reflectionProperties = []; |
| 380 | 380 | foreach ($instance->getProperties() as $reflectionProperty) { |
| 381 | 381 | if (!$reflectionProperty->isPrivate()) { |