Skip to content

Commit d6025fa

Browse files
committed
Adds support for array closures in Generic.CodeAnalysis.UnusedFunctionParameter
Related to #2523
1 parent 80ebd4a commit d6025fa

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function register()
3434
return [
3535
T_FUNCTION,
3636
T_CLOSURE,
37+
T_FN,
3738
];
3839

3940
}//end register()

src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,5 @@ function something($a) {
121121
function myCallback($a, $b, $c, $d) {
122122
return $a * $c;
123123
}
124+
125+
fn ($a, $b, $c) => $b;

src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function getWarningList()
4949
106 => 1,
5050
117 => 1,
5151
121 => 2,
52+
125 => 2,
5253
];
5354

5455
}//end getWarningList()

0 commit comments

Comments
 (0)