From 66668e73386c8304e547d7811e6b46d528d5628f Mon Sep 17 00:00:00 2001 From: David Petersen Date: Mon, 15 Jul 2024 16:51:59 -0500 Subject: [PATCH] test: add test for nested arrow functions This adds a test for a nested arrow function case that shouldn't show a warning. --- .../VariableAnalysisSniff/fixtures/ArrowFunctionFixture.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/VariableAnalysisSniff/fixtures/ArrowFunctionFixture.php b/Tests/VariableAnalysisSniff/fixtures/ArrowFunctionFixture.php index 9a16dc4..f23ac6b 100644 --- a/Tests/VariableAnalysisSniff/fixtures/ArrowFunctionFixture.php +++ b/Tests/VariableAnalysisSniff/fixtures/ArrowFunctionFixture.php @@ -166,3 +166,8 @@ function arrowFunctionWithQuotes($allowedReferrers) { && $permissionName !== CustomPermission::ALL_CONFIG ); } + +function arrowFunctionNestedAsExpressionWithNoWarnings() { + $ids = fn($posts) => array_map(fn($post) => $post->id, $posts); + echo $ids([]); +}