@@ -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 | { |
@@ -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. |
@@ -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()) { |
@@ -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 | } |