diff --git a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc index 811c56ec14..c3af6ce55f 100644 --- a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc +++ b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc @@ -302,3 +302,24 @@ new ExceptionMessage(), ) { } } + +$arrowNoArgs = fn () => $retrievedfromscope; + +$arrowSingleLineArgs = fn (Type $param1, int $param2, string $param3): \ReturnType => $retrievedfromscope; + +$arrowMultiLineArgs = fn ( + $longVar1, + $longerVar2, + &...$muchLongerVar3 +) => $longVar1; + +$arrowNoArgs = fn( ) + => $retrievedfromscope; + +$arrowSingleLineArgs = fn( Type $param1 , int $param2, string $param3 + ) : \ReturnType => $retrievedfromscope; + +$arrowMultiLineArgs = fn ( + $longVar1, $longerVar2, + + & ... $muchLongerVar3) => $longVar1; diff --git a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed index c38e3ecc0a..ce0421644c 100644 --- a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed +++ b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed @@ -314,3 +314,24 @@ new ExceptionMessage(), ) { } } + +$arrowNoArgs = fn () => $retrievedfromscope; + +$arrowSingleLineArgs = fn (Type $param1, int $param2, string $param3): \ReturnType => $retrievedfromscope; + +$arrowMultiLineArgs = fn ( + $longVar1, + $longerVar2, + &...$muchLongerVar3 +) => $longVar1; + +$arrowNoArgs = fn ( ) + => $retrievedfromscope; + +$arrowSingleLineArgs = fn ( Type $param1 , int $param2, string $param3) : \ReturnType => $retrievedfromscope; + +$arrowMultiLineArgs = fn ( + $longVar1, + $longerVar2, + & ... $muchLongerVar3 +) => $longVar1; diff --git a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php index 5208ad0cdb..4fb74ea194 100644 --- a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php @@ -70,6 +70,12 @@ public function getErrorList($testFile='MultiLineFunctionDeclarationUnitTest.inc 252 => 1, 253 => 1, 254 => 1, + 316 => 1, + 319 => 1, + 320 => 1, + 323 => 1, + 324 => 1, + 325 => 2, ]; } else { $errors = [