@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * Initializes reflection instance |
| 27 | 27 | * |
| 28 | - * @param string|object $argument Class name or instance of object |
|
| 28 | + * @param string $argument Class name or instance of object |
|
| 29 | 29 | * @param ClassLike $classLikeNode AST node for class |
| 30 | 30 | */ |
| 31 | 31 | public function __construct($argument, ClassLike $classLikeNode = null) |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | /** |
| 25 | 25 | * Initializes reflection instance for given AST-node |
| 26 | 26 | * |
| 27 | - * @param string|\Closure $functionName The name of the function to reflect or a closure. |
|
| 28 | - * @param Function_|null $functionNode Function node AST |
|
| 27 | + * @param string $functionName The name of the function to reflect or a closure. |
|
| 28 | + * @param Function_ $functionNode Function node AST |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct($functionName, Function_ $functionNode) |
| 31 | 31 | { |
@@ -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 | ); |
@@ -306,6 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | /** |
| 308 | 308 | * {@inheritdoc} |
| 309 | + * @param string $name |
|
| 309 | 310 | */ |
| 310 | 311 | public function getMethod($name) |
| 311 | 312 | { |
@@ -499,6 +500,7 @@ discard block |
||
| 499 | 500 | |
| 500 | 501 | /** |
| 501 | 502 | * {@inheritdoc} |
| 503 | + * @param string $name |
|
| 502 | 504 | */ |
| 503 | 505 | public function hasMethod($name) |
| 504 | 506 | { |
@@ -529,6 +531,7 @@ discard block |
||
| 529 | 531 | |
| 530 | 532 | /** |
| 531 | 533 | * {@inheritDoc} |
| 534 | + * @param string $interfaceName |
|
| 532 | 535 | */ |
| 533 | 536 | public function implementsInterface($interfaceName) |
| 534 | 537 | { |
@@ -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()) { |
@@ -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); |
@@ -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 | } |
@@ -37,6 +37,9 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | private $topLevelNodes; |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string $fileName |
|
| 42 | + */ |
|
| 40 | 43 | public function __construct($fileName, $topLevelNodes = null) |
| 41 | 44 | { |
| 42 | 45 | $this->fileName = $fileName; |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | $parameterIndex = 0, |
| 89 | 89 | \ReflectionFunctionAbstract $declaringFunction = null |
| 90 | 90 | ) { |
| 91 | - $this->functionName = $functionName; |
|
| 91 | + $this->functionName = $functionName; |
|
| 92 | 92 | // Let's unset original read-only property to have a control over it via __get |
| 93 | 93 | unset($this->name); |
| 94 | 94 | |