File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -141,12 +141,18 @@ public function enterNode(Node $node): void
141
141
if (
142
142
$ node instanceof Node \Stmt \Return_ ||
143
143
$ node instanceof Node \Stmt \Continue_ ||
144
- $ node instanceof Node \Stmt \Break_
144
+ $ node instanceof Node \Stmt \Break_ ||
145
+ $ node instanceof Node \Stmt \Goto_ ||
146
+ $ node instanceof Node \Stmt \Label
145
147
) {
146
148
$ returnBranch = $ this ->executableLinesGroupedByBranch [$ node ->getStartLine ()];
147
149
$ returnEndLine = $ node ->getEndLine ();
148
150
$ nextBranch = null ;
149
151
152
+ if ($ node instanceof Node \Stmt \Label) {
153
+ $ returnEndLine = $ node ->getStartLine () - 1 ;
154
+ }
155
+
150
156
foreach ($ this ->executableLinesGroupedByBranch as $ line => $ branch ) {
151
157
if ($ line <= $ returnEndLine || $ branch !== $ returnBranch ) {
152
158
continue ;
Original file line number Diff line number Diff line change @@ -297,4 +297,21 @@ public function withBreak() // +5
297
297
++$ var ; // +3
298
298
} // -4
299
299
}
300
+ public function withGoto () // +5
301
+ { // 0
302
+ $ var = 1 ; // 0
303
+ if (false ) { // 0
304
+ ++$ var ; // +1
305
+ goto // 0
306
+ a // 0
307
+ ; // 0
308
+ ++$ var ; // +1
309
+ } // -2
310
+ ++$ var ; // 0
311
+ a // +3
312
+ : // 0
313
+ ++$ var ; // 0
314
+ b: // +1
315
+ ++$ var ; // 0
316
+ }
300
317
}
You can’t perform that action at this time.
0 commit comments