Skip to content

Commit e95c077

Browse files
committed
Adds support for PHP 7.4 arrow functions in PEAR.Functions.ValidDefaultValue sniff
Related to #2523
1 parent 68e0b06 commit e95c077

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function register()
2626
return [
2727
T_FUNCTION,
2828
T_CLOSURE,
29+
T_FN,
2930
];
3031

3132
}//end register()

src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,7 @@ $closure = function ($arg1, $arg2='hello') {};
9898
// Invalid closure
9999
$closure = function(array $arg2=array(), array $arg1) {}
100100

101+
$fn = fn($a = [], $b) => $a[] = $b;
102+
101103
// Intentional syntax error. Must be last thing in the file.
102104
function

src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function getErrorList()
3434
81 => 1,
3535
91 => 1,
3636
99 => 1,
37+
101 => 1,
3738
];
3839

3940
}//end getErrorList()

0 commit comments

Comments
 (0)