diff --git a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc index fce0b237ba..3b56f64068 100644 --- a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc +++ b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc @@ -255,3 +255,24 @@ private string $private, ) { } } + +$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 b927a001b3..3a9f170962 100644 --- a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed +++ b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed @@ -267,3 +267,24 @@ class ConstructorPropertyPromotionMultiLineDocblockAndAttributeIncorrectIndent ) { } } + +$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..dcc1654024 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, + 269 => 1, + 272 => 1, + 273 => 1, + 276 => 1, + 277 => 1, + 278 => 2, ]; } else { $errors = [