From f01098dd148942e1750cd23ee4ead4cb777f7f4a Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 19 May 2024 20:53:50 +0200 Subject: [PATCH] Generic/ScopeIndent: add test for issue 437 Fixes #437 --- .../Tests/WhiteSpace/ScopeIndentUnitTest.1.inc | 15 +++++++++++++++ .../WhiteSpace/ScopeIndentUnitTest.1.inc.fixed | 15 +++++++++++++++ .../Tests/WhiteSpace/ScopeIndentUnitTest.2.inc | 15 +++++++++++++++ .../WhiteSpace/ScopeIndentUnitTest.2.inc.fixed | 15 +++++++++++++++ .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 8 ++++---- 5 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc index 4061aff567..f88e5e6d2a 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc @@ -1579,6 +1579,21 @@ foo(function ($foo) { ]; }); +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed index 7b5efea36a..2af4589207 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed @@ -1579,6 +1579,21 @@ foo(function ($foo) { ]; }); +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc index e7253141d4..b93174a040 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc @@ -1579,6 +1579,21 @@ foo(function ($foo) { ]; }); +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed index 57caa29175..0737344a1d 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed @@ -1579,6 +1579,21 @@ foo(function ($foo) { ]; }); +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php index 2533b434c0..873bf89f1f 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -192,10 +192,10 @@ public function getErrorList($testFile='') 1527 => 1, 1529 => 1, 1530 => 1, - 1590 => 1, - 1591 => 1, - 1592 => 1, - 1593 => 1, + 1605 => 1, + 1606 => 1, + 1607 => 1, + 1608 => 1, ]; }//end getErrorList()