File tree Expand file tree Collapse file tree 2 files changed +14
-25
lines changed Expand file tree Collapse file tree 2 files changed +14
-25
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ public function enterNode(Node $node): void
6161 $ node instanceof Node \Stmt \TryCatch ||
6262 $ node instanceof Node \Stmt \Use_ ||
6363 $ node instanceof Node \Stmt \UseUse ||
64+ $ node instanceof Node \Expr \Match_ ||
6465 $ node instanceof Node \Expr \Variable ||
6566 $ node instanceof Node \Const_ ||
6667 $ node instanceof Node \Identifier ||
@@ -241,18 +242,6 @@ public function enterNode(Node $node): void
241242 return ;
242243 }
243244
244- if ($ node instanceof Node \Expr \Match_) {
245- foreach ($ node ->arms as $ arm ) {
246- $ this ->setLineBranch (
247- $ arm ->body ->getStartLine (),
248- $ arm ->body ->getEndLine (),
249- ++$ this ->nextBranch
250- );
251- }
252-
253- return ;
254- }
255-
256245 if ($ node instanceof Node \Stmt \Catch_) {
257246 assert ([] !== $ node ->types );
258247 $ startLine = $ node ->types [0 ]->getStartLine ();
Original file line number Diff line number Diff line change @@ -243,11 +243,11 @@ public function withMatch()
243243 {
244244 $ var = 1 ; // +1
245245 $ var2 = match ($ var ) { // +1
246- 0 => ++$ var , // +1
247- 1 => ++$ var , // +1
248- default => ++$ var , // +1
249- }; // -3
250- $ var2 // +4
246+ 0 => ++$ var , // 0
247+ 1 => ++$ var , // 0
248+ default => ++$ var , // 0
249+ }; // 0
250+ $ var2 // +1
251251 = // 0
252252 match // 0
253253 ( // 0
@@ -256,23 +256,23 @@ public function withMatch()
256256 { // 0
257257 0 // 0
258258 => // 0
259- ++$ var // +1
260- , // -1
259+ ++$ var // 0
260+ , // 0
261261 1 , // 0
262262 2 // 0
263263 => // 0
264- ++$ var // +2
265- , // -2
264+ ++$ var // 0
265+ , // 0
266266 default // 0
267267 => // 0
268- ++$ var // +3
269- , // -3
268+ ++$ var // 0
269+ , // 0
270270 } // 0
271271 ; // 0
272272 }
273273 public function withReturn ()
274274 {
275- $ var = 1 ; // +4
275+ $ var = 1 ; // +1
276276 if (false ) { // +1
277277 ++$ var ; // +1
278278 return // +1
@@ -568,4 +568,4 @@ final class MyFinalClass extends MyAbstractClass
568568 public function myMethod (): void
569569 {
570570 } // +4
571- }
571+ }
You can’t perform that action at this time.
0 commit comments