File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
tests/Rule/data/ForbidUnusedMatchResultRule Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 55use PhpParser \Node ;
66use PhpParser \Node \Arg ;
77use PhpParser \Node \ArrayItem ;
8+ use PhpParser \Node \Expr \ArrowFunction ;
89use PhpParser \Node \Expr \Assign ;
910use PhpParser \Node \Expr \AssignOp ;
1011use PhpParser \Node \Expr \BinaryOp \Coalesce ;
@@ -86,7 +87,8 @@ private function isUsed(Node $parent): bool
8687 || $ parent instanceof Ternary
8788 || $ parent instanceof MatchArm
8889 || $ parent instanceof Yield_
89- || $ parent instanceof YieldFrom;
90+ || $ parent instanceof YieldFrom
91+ || $ parent instanceof ArrowFunction;
9092 }
9193
9294}
Original file line number Diff line number Diff line change @@ -70,6 +70,18 @@ public function testUsed(bool $bool): mixed
7070 1 => 'y ' ,
7171 } : null ;
7272
73+ function ($ int ) {
74+ return match ($ int ) {
75+ 0 => 'x ' ,
76+ 1 => 'y ' ,
77+ };
78+ };
79+
80+ fn () => match ($ int ) {
81+ 0 => 'x ' ,
82+ 1 => 'y ' ,
83+ };
84+
7385 return match ($ bool ) {
7486 false => 1 ,
7587 true => 2 ,
You can’t perform that action at this time.
0 commit comments