File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
tests/Rule/data/ForbidUnusedMatchResultRule Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 6
6
use PhpParser \Node \Arg ;
7
7
use PhpParser \Node \Expr \ArrayItem ;
8
8
use PhpParser \Node \Expr \Assign ;
9
+ use PhpParser \Node \Expr \AssignOp ;
9
10
use PhpParser \Node \Expr \BinaryOp \Coalesce ;
10
11
use PhpParser \Node \Expr \Match_ ;
11
12
use PhpParser \Node \Expr \MethodCall ;
@@ -76,6 +77,7 @@ private function isUsed(Node $parent): bool
76
77
{
77
78
return $ parent instanceof Throw_
78
79
|| $ parent instanceof Assign
80
+ || $ parent instanceof AssignOp
79
81
|| $ parent instanceof MethodCall
80
82
|| $ parent instanceof Return_
81
83
|| $ parent instanceof Arg
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ public function testUsed(bool $bool): mixed
33
33
},
34
34
};
35
35
36
+ $ b += match ($ int ) {
37
+ 0 => 0 ,
38
+ default => 1 ,
39
+ };
40
+
36
41
$ this ->use (match ($ bool ) {
37
42
false => new LogicException (),
38
43
true => new RuntimeException (),
You can’t perform that action at this time.
0 commit comments