@@ -12,25 +12,25 @@ |
||
12 | 12 | use Benoth\StaticReflection\Reflection\ReflectionProperty; |
13 | 13 | use Benoth\StaticReflection\Reflection\ReflectionTrait; |
14 | 14 | use PhpParser\Node as NodeInterface; |
15 | +use PhpParser\NodeVisitorAbstract; |
|
15 | 16 | use PhpParser\Node\Expr as AbstractExprNode; |
16 | -use PhpParser\Node\Expr\Yield_ as YieldNode; |
|
17 | 17 | use PhpParser\Node\Expr\YieldFrom as YieldFromNode; |
18 | +use PhpParser\Node\Expr\Yield_ as YieldNode; |
|
18 | 19 | use PhpParser\Node\Scalar\MagicConst; |
19 | 20 | use PhpParser\Node\Stmt as AbstractNode; |
20 | -use PhpParser\Node\Stmt\Class_ as ClassNode; |
|
21 | 21 | use PhpParser\Node\Stmt\ClassConst as ClassConstNode; |
22 | 22 | use PhpParser\Node\Stmt\ClassMethod as ClassMethodNode; |
23 | +use PhpParser\Node\Stmt\Class_ as ClassNode; |
|
23 | 24 | use PhpParser\Node\Stmt\Function_ as FunctionNode; |
24 | 25 | use PhpParser\Node\Stmt\Interface_ as InterfaceNode; |
25 | 26 | use PhpParser\Node\Stmt\Namespace_ as NamespaceNode; |
26 | 27 | use PhpParser\Node\Stmt\Property as PropertyNode; |
27 | 28 | use PhpParser\Node\Stmt\Static_ as StaticNode; |
28 | -use PhpParser\Node\Stmt\Trait_ as TraitNode; |
|
29 | 29 | use PhpParser\Node\Stmt\TraitUse as TraitUseNode; |
30 | 30 | use PhpParser\Node\Stmt\TraitUseAdaptation\Alias as TraitUseAliasNode; |
31 | 31 | use PhpParser\Node\Stmt\TraitUseAdaptation\Precedence as TraitUsePrecedenceNode; |
32 | +use PhpParser\Node\Stmt\Trait_ as TraitNode; |
|
32 | 33 | use PhpParser\Node\Stmt\Use_ as UseNode; |
33 | -use PhpParser\NodeVisitorAbstract; |
|
34 | 34 | |
35 | 35 | class ReflectorNodeVisitor extends NodeVisitorAbstract |
36 | 36 | { |
@@ -142,7 +142,6 @@ |
||
142 | 142 | * Gets static property value. |
143 | 143 | * |
144 | 144 | * @param string $name The name of the static property |
145 | - * @param mixed $default Optional default value to return if the property does not exist |
|
146 | 145 | * |
147 | 146 | * @throws \ReflectionException If the property does not exist and default value is omitted. |
148 | 147 | * |
@@ -210,7 +210,7 @@ |
||
210 | 210 | return $properties; |
211 | 211 | } |
212 | 212 | |
213 | - return array_filter($properties, function (ReflectionProperty $property) use ($filter) { |
|
213 | + return array_filter($properties, function(ReflectionProperty $property) use ($filter) { |
|
214 | 214 | if (self::IS_PRIVATE === (self::IS_PRIVATE & $filter) && $property->isPrivate()) { |
215 | 215 | return true; |
216 | 216 | } elseif (self::IS_PROTECTED === (self::IS_PROTECTED & $filter) && $property->isProtected()) { |
@@ -132,7 +132,7 @@ |
||
132 | 132 | /** |
133 | 133 | * Gets the name of the extension which defined the entity. |
134 | 134 | * |
135 | - * @return string|bool Extension name or false for user defined |
|
135 | + * @return boolean Extension name or false for user defined |
|
136 | 136 | */ |
137 | 137 | public function getExtensionName() |
138 | 138 | { |
@@ -35,6 +35,9 @@ |
||
35 | 35 | return $this->index->getClass($this->getParent()); |
36 | 36 | } |
37 | 37 | |
38 | + /** |
|
39 | + * @param string $parent |
|
40 | + */ |
|
38 | 41 | public function setParent($parent) |
39 | 42 | { |
40 | 43 | $this->parent = $parent; |
@@ -217,7 +217,6 @@ discard block |
||
217 | 217 | * |
218 | 218 | * |
219 | 219 | * @param object $object The object to invoke the method on. For static methods, pass null to this parameter. |
220 | - * @param mixed $parameter Zero or more parameters to be passed to the method. It accepts a variable number of parameters which are passed to the method. |
|
221 | 220 | * |
222 | 221 | * @throws \ReflectionException Always... Can't be implemented. |
223 | 222 | * |
@@ -251,6 +250,9 @@ discard block |
||
251 | 250 | return $this; |
252 | 251 | } |
253 | 252 | |
253 | + /** |
|
254 | + * @param string $name |
|
255 | + */ |
|
254 | 256 | public function addStaticVariable($name, $value) |
255 | 257 | { |
256 | 258 | $this->staticVariables[(string) $name] = $value; |
@@ -258,6 +260,9 @@ discard block |
||
258 | 260 | return $this; |
259 | 261 | } |
260 | 262 | |
263 | + /** |
|
264 | + * @param boolean $returnsByRef |
|
265 | + */ |
|
261 | 266 | public function setReturnsByRef($returnsByRef) |
262 | 267 | { |
263 | 268 | $this->returnsByRef = (bool) $returnsByRef; |
@@ -265,6 +270,9 @@ discard block |
||
265 | 270 | return $this; |
266 | 271 | } |
267 | 272 | |
273 | + /** |
|
274 | + * @param boolean $isGenerator |
|
275 | + */ |
|
268 | 276 | public function setGenerator($isGenerator) |
269 | 277 | { |
270 | 278 | $this->isGenerator = (bool) $isGenerator; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * @type bool |
9 | 9 | */ |
10 | - protected $isAbstract = false; |
|
10 | + protected $isAbstract = false; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Checks if a class is abstract. |
@@ -252,7 +252,7 @@ |
||
252 | 252 | return $methods; |
253 | 253 | } |
254 | 254 | |
255 | - return array_filter($methods, function (ReflectionMethod $method) use ($filter) { |
|
255 | + return array_filter($methods, function(ReflectionMethod $method) use ($filter) { |
|
256 | 256 | if (self::IS_PRIVATE === (self::IS_PRIVATE & $filter) && $method->isPrivate()) { |
257 | 257 | return true; |
258 | 258 | } elseif (self::IS_PROTECTED === (self::IS_PROTECTED & $filter) && $method->isProtected()) { |
@@ -27,35 +27,35 @@ discard block |
||
27 | 27 | |
28 | 28 | public function getClassLikes() |
29 | 29 | { |
30 | - return array_filter($this->reflections, function ($reflection) { |
|
30 | + return array_filter($this->reflections, function($reflection) { |
|
31 | 31 | return $reflection instanceof ReflectionClassLike; |
32 | 32 | }); |
33 | 33 | } |
34 | 34 | |
35 | 35 | public function getClasses() |
36 | 36 | { |
37 | - return array_filter($this->reflections, function ($reflection) { |
|
37 | + return array_filter($this->reflections, function($reflection) { |
|
38 | 38 | return $reflection instanceof ReflectionClass; |
39 | 39 | }); |
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getInterfaces() |
43 | 43 | { |
44 | - return array_filter($this->reflections, function ($reflection) { |
|
44 | + return array_filter($this->reflections, function($reflection) { |
|
45 | 45 | return $reflection instanceof ReflectionInterface; |
46 | 46 | }); |
47 | 47 | } |
48 | 48 | |
49 | 49 | public function getTraits() |
50 | 50 | { |
51 | - return array_filter($this->reflections, function ($reflection) { |
|
51 | + return array_filter($this->reflections, function($reflection) { |
|
52 | 52 | return $reflection instanceof ReflectionTrait; |
53 | 53 | }); |
54 | 54 | } |
55 | 55 | |
56 | 56 | public function getFunctionLikes() |
57 | 57 | { |
58 | - $functions = array_filter($this->reflections, function ($reflection) { |
|
58 | + $functions = array_filter($this->reflections, function($reflection) { |
|
59 | 59 | return $reflection instanceof ReflectionFunction; |
60 | 60 | }); |
61 | 61 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | public function getFunctions() |
70 | 70 | { |
71 | - return array_filter($this->reflections, function ($reflection) { |
|
71 | + return array_filter($this->reflections, function($reflection) { |
|
72 | 72 | return $reflection instanceof ReflectionFunction; |
73 | 73 | }); |
74 | 74 | } |