From fd98546ce3373aa7767240901eda47963ce64c82 Mon Sep 17 00:00:00 2001 From: Jonathan Smith <jonathan1055@sandfordsolutions.com> Date: Thu, 28 Nov 2024 23:14:29 +0000 Subject: [PATCH] fix(AlphabeticallySortedUses): Remove use statement order rule (#3483028) --- coder_sniffer/Drupal/ruleset.xml | 5 ----- .../Drupal/Classes/ClassCreateInstanceUnitTest.inc.fixed | 2 +- .../Classes/FullyQualifiedNamespaceUnitTest.inc.fixed | 8 ++++---- tests/Drupal/Classes/UnusedUseStatementUnitTest.inc.fixed | 8 ++++---- tests/Drupal/Classes/UseGlobalClassUnitTest.inc.fixed | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/coder_sniffer/Drupal/ruleset.xml b/coder_sniffer/Drupal/ruleset.xml index ac74554e..2eb97154 100644 --- a/coder_sniffer/Drupal/ruleset.xml +++ b/coder_sniffer/Drupal/ruleset.xml @@ -121,11 +121,6 @@ <rule ref="PSR2.Namespaces.UseDeclaration" /> <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" /> - <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"> - <properties> - <property name="caseSensitive" value="true"/> - </properties> - </rule> <rule ref="SlevomatCodingStandard.PHP.ShortList" /> <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/> diff --git a/tests/Drupal/Classes/ClassCreateInstanceUnitTest.inc.fixed b/tests/Drupal/Classes/ClassCreateInstanceUnitTest.inc.fixed index 41618cb4..09663bcd 100644 --- a/tests/Drupal/Classes/ClassCreateInstanceUnitTest.inc.fixed +++ b/tests/Drupal/Classes/ClassCreateInstanceUnitTest.inc.fixed @@ -1,7 +1,7 @@ <?php -use Vendor\DateTools; use Vendor\DateTools\DateInterval; +use Vendor\DateTools; $x = array(new Foo(), array()); $y = new Foo(); diff --git a/tests/Drupal/Classes/FullyQualifiedNamespaceUnitTest.inc.fixed b/tests/Drupal/Classes/FullyQualifiedNamespaceUnitTest.inc.fixed index 93fe2e4e..004f9eaa 100644 --- a/tests/Drupal/Classes/FullyQualifiedNamespaceUnitTest.inc.fixed +++ b/tests/Drupal/Classes/FullyQualifiedNamespaceUnitTest.inc.fixed @@ -5,12 +5,12 @@ * Example. */ -use Test\Alias as TestAlias; -use Test\Bar; -use Test\Foo; -use Test\MultiLine as MultiLineAlias; use Test\MultiLineSecond; +use Test\Foo; use Test\NotUsed; +use Test\Bar; +use Test\Alias as TestAlias; +use Test\MultiLine as MultiLineAlias; /** * Example. diff --git a/tests/Drupal/Classes/UnusedUseStatementUnitTest.inc.fixed b/tests/Drupal/Classes/UnusedUseStatementUnitTest.inc.fixed index 89eefada..2c620518 100644 --- a/tests/Drupal/Classes/UnusedUseStatementUnitTest.inc.fixed +++ b/tests/Drupal/Classes/UnusedUseStatementUnitTest.inc.fixed @@ -2,12 +2,12 @@ namespace MyNamespace\Depth; -use Example\MyUrlHelper; -use MyNamespace\Depth\SomeClass as CoreSomeClass; +use Thing\NotUsed; +use Thing\Fail\ActuallyUsed; use Test\TraitTest; use Thing\DifferentName as UsedOtherName; -use Thing\Fail\ActuallyUsed; -use Thing\NotUsed; +use Example\MyUrlHelper; +use MyNamespace\Depth\SomeClass as CoreSomeClass; /** * Bla. diff --git a/tests/Drupal/Classes/UseGlobalClassUnitTest.inc.fixed b/tests/Drupal/Classes/UseGlobalClassUnitTest.inc.fixed index c46e66e9..a1518555 100644 --- a/tests/Drupal/Classes/UseGlobalClassUnitTest.inc.fixed +++ b/tests/Drupal/Classes/UseGlobalClassUnitTest.inc.fixed @@ -5,9 +5,9 @@ * Example. */ -use Namespaced\MultiLine2 as MultiLineAlias2; use Namespaced\TestClass; use Namespaced\TestClassSecond as NamespacedAlias; +use Namespaced\MultiLine2 as MultiLineAlias2; use function count; /** -- GitLab