10
10
namespace SebastianBergmann \CodeCoverage \StaticAnalysis ;
11
11
12
12
use function assert ;
13
- use function range ;
14
13
use PhpParser \Node ;
15
14
use PhpParser \Node \Attribute ;
16
15
use PhpParser \Node \Stmt \Class_ ;
@@ -80,7 +79,7 @@ public function enterNode(Node $node): void
80
79
$ attributeGroup = $ node ->getAttribute ('parent ' );
81
80
$ attributedNode = $ attributeGroup ->getAttribute ('parent ' );
82
81
83
- foreach ( range ( $ attributedNode ->getStartLine (), $ attributedNode ->getEndLine ()) as $ line ) {
82
+ for ( $ line = $ attributedNode ->getStartLine (); $ line <= $ attributedNode ->getEndLine (); $ line++ ) {
84
83
$ this ->ignoredLines [] = $ line ;
85
84
}
86
85
@@ -91,7 +90,7 @@ public function enterNode(Node $node): void
91
90
}
92
91
93
92
/**
94
- * @psalm-return list <int>
93
+ * @psalm-return array <int>
95
94
*/
96
95
public function ignoredLines (): array
97
96
{
@@ -107,13 +106,13 @@ private function processDocComment(Node $node): void
107
106
}
108
107
109
108
if (str_contains ($ docComment ->getText (), '@codeCoverageIgnore ' )) {
110
- foreach ( range ( $ node ->getStartLine (), $ node ->getEndLine ()) as $ line ) {
109
+ for ( $ line = $ node ->getStartLine (); $ line <= $ node ->getEndLine (); $ line++ ) {
111
110
$ this ->ignoredLines [] = $ line ;
112
111
}
113
112
}
114
113
115
114
if ($ this ->ignoreDeprecated && str_contains ($ docComment ->getText (), '@deprecated ' )) {
116
- foreach ( range ( $ node ->getStartLine (), $ node ->getEndLine ()) as $ line ) {
115
+ for ( $ line = $ node ->getStartLine (); $ line <= $ node ->getEndLine (); $ line++ ) {
117
116
$ this ->ignoredLines [] = $ line ;
118
117
}
119
118
}
0 commit comments