From 2212c7275df73876252845a91bd501632da66c6b Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 5 Apr 2025 02:26:50 +0200 Subject: [PATCH] PSR12/ImportStatement: test tweak Looking at the tests, each type of import `use` should have at least one test with a leading namespace separator and one without to properly cover what the sniff is looking for. Looks like adding the leading `\` was missed for the `use const` tests. --- .../PSR12/Tests/Files/ImportStatementUnitTest.inc | 2 +- .../PSR12/Tests/Files/ImportStatementUnitTest.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc b/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc index 6d024eaa95..beb692b1fe 100644 --- a/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc +++ b/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc @@ -7,7 +7,7 @@ use function Vendor\Package\{functionA, functionB, functionC}; use FUNCTION \Another\Vendor\functionD; use CONST Vendor\Package\{CONSTANT_A, CONSTANT_B, CONSTANT_C}; -use const Another\Vendor\CONSTANT_D; +use const \Another\Vendor\CONSTANT_D; class ClassName3 { diff --git a/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php b/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php index 86bca2d0c4..e82667b5a5 100644 --- a/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php +++ b/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php @@ -31,9 +31,10 @@ final class ImportStatementUnitTest extends AbstractSniffUnitTest public function getErrorList() { return [ - 2 => 1, - 4 => 1, - 7 => 1, + 2 => 1, + 4 => 1, + 7 => 1, + 10 => 1, ]; }//end getErrorList()