File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,11 @@ public function enterNode(Node $node): void
138138 return ;
139139 }
140140
141- if ($ node instanceof Node \Stmt \Return_) {
141+ if (
142+ $ node instanceof Node \Stmt \Return_ ||
143+ $ node instanceof Node \Stmt \Continue_ ||
144+ $ node instanceof Node \Stmt \Break_
145+ ) {
142146 $ returnBranch = $ this ->executableLinesGroupedByBranch [$ node ->getStartLine ()];
143147 $ returnEndLine = $ node ->getEndLine ();
144148 $ nextBranch = null ;
Original file line number Diff line number Diff line change @@ -265,4 +265,36 @@ public function withReturn() // +7
265265 return ; // 0
266266 ++$ var ; // +4
267267 }
268+ public function withContinue () // +1
269+ { // 0
270+ $ var = 1 ; // 0
271+ for ($ i = 0 ; $ i < 10 ; $ i ++) { // 0
272+ if (false ) { // +1
273+ ++$ var ; // +1
274+ continue // 0
275+ 1 // 0
276+ ; // 0
277+ ++$ var ; // +1
278+ } // -2
279+ ++$ var ; // 0
280+ continue ; // 0
281+ ++$ var ; // +3
282+ } // -4
283+ }
284+ public function withBreak () // +5
285+ { // 0
286+ $ var = 1 ; // 0
287+ for ($ i = 0 ; $ i < 10 ; $ i ++) { // 0
288+ if (false ) { // +1
289+ ++$ var ; // +1
290+ break // 0
291+ 1 // 0
292+ ; // 0
293+ ++$ var ; // +1
294+ } // -2
295+ ++$ var ; // 0
296+ break ; // 0
297+ ++$ var ; // +3
298+ } // -4
299+ }
268300}
You can’t perform that action at this time.
0 commit comments