18
18
use PhpParser \Node \Stmt \Function_ ;
19
19
use PhpParser \Node \Stmt \Interface_ ;
20
20
use PhpParser \Node \Stmt \Trait_ ;
21
- use PhpParser \NodeTraverser ;
22
21
use PhpParser \NodeVisitorAbstract ;
23
22
24
23
/**
@@ -47,18 +46,18 @@ public function __construct(bool $useAnnotationsForIgnoringCode, bool $ignoreDep
47
46
$ this ->ignoreDeprecated = $ ignoreDeprecated ;
48
47
}
49
48
50
- public function enterNode (Node $ node ): ? int
49
+ public function enterNode (Node $ node ): void
51
50
{
52
51
if (!$ node instanceof Class_ &&
53
52
!$ node instanceof Trait_ &&
54
53
!$ node instanceof Interface_ &&
55
54
!$ node instanceof ClassMethod &&
56
55
!$ node instanceof Function_) {
57
- return null ;
56
+ return ;
58
57
}
59
58
60
59
if ($ node instanceof Class_ && $ node ->isAnonymous ()) {
61
- return null ;
60
+ return ;
62
61
}
63
62
64
63
// Workaround for https://bugs.xdebug.org/view.php?id=1798
@@ -69,17 +68,17 @@ public function enterNode(Node $node): ?int
69
68
}
70
69
71
70
if (!$ this ->useAnnotationsForIgnoringCode ) {
72
- return null ;
71
+ return ;
73
72
}
74
73
75
74
if ($ node instanceof Interface_) {
76
- return null ;
75
+ return ;
77
76
}
78
77
79
78
$ docComment = $ node ->getDocComment ();
80
79
81
80
if ($ docComment === null ) {
82
- return null ;
81
+ return ;
83
82
}
84
83
85
84
if (strpos ($ docComment ->getText (), '@codeCoverageIgnore ' ) !== false ) {
@@ -95,12 +94,6 @@ public function enterNode(Node $node): ?int
95
94
range ($ node ->getStartLine (), $ node ->getEndLine ())
96
95
);
97
96
}
98
-
99
- if ($ node instanceof ClassMethod || $ node instanceof Function_) {
100
- return NodeTraverser::DONT_TRAVERSE_CHILDREN ;
101
- }
102
-
103
- return null ;
104
97
}
105
98
106
99
/**
0 commit comments