From 52456310d2a6e5a1f8604d9cd31394f55fefe386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 4 Jan 2024 10:22:28 +0100 Subject: [PATCH] Enhancement: Enable PhpCsFixerCustomFixers/no_import_from_global_namespace fixer --- CHANGELOG.md | 2 ++ src/RuleSet/Php53.php | 2 ++ src/RuleSet/Php54.php | 2 ++ src/RuleSet/Php55.php | 2 ++ src/RuleSet/Php56.php | 2 ++ src/RuleSet/Php70.php | 2 ++ src/RuleSet/Php71.php | 2 ++ src/RuleSet/Php72.php | 2 ++ src/RuleSet/Php73.php | 2 ++ src/RuleSet/Php74.php | 2 ++ src/RuleSet/Php80.php | 2 ++ src/RuleSet/Php81.php | 2 ++ src/RuleSet/Php82.php | 2 ++ src/RuleSet/Php83.php | 2 ++ test/Unit/RuleSet/Php53Test.php | 2 ++ test/Unit/RuleSet/Php54Test.php | 2 ++ test/Unit/RuleSet/Php55Test.php | 2 ++ test/Unit/RuleSet/Php56Test.php | 2 ++ test/Unit/RuleSet/Php70Test.php | 2 ++ test/Unit/RuleSet/Php71Test.php | 2 ++ test/Unit/RuleSet/Php72Test.php | 2 ++ test/Unit/RuleSet/Php73Test.php | 2 ++ test/Unit/RuleSet/Php74Test.php | 2 ++ test/Unit/RuleSet/Php80Test.php | 2 ++ test/Unit/RuleSet/Php81Test.php | 2 ++ test/Unit/RuleSet/Php82Test.php | 2 ++ test/Unit/RuleSet/Php83Test.php | 2 ++ 27 files changed, 54 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f71a1f..e43696dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ For a full diff see [`6.18.0...main`][6.18.0...main]. - Enabled the `PhpCsFixerCustomFixers/multiline_promoted_properties` fixer ([#975]), by [@localheinz] - Enabled the `PhpCsFixerCustomFixers/no_duplicated_array_key` fixer ([#976]), by [@localheinz] - Enabled the `PhpCsFixerCustomFixers/no_duplicated_imports` fixer ([#977]), by [@localheinz] +- Enabled the `PhpCsFixerCustomFixers/no_import_from_global_namespace` fixer ([#978]), by [@localheinz] ## [`6.18.0`][6.18.0] @@ -1490,6 +1491,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#975]: https://github.com/ergebnis/php-cs-fixer-config/pull/975 [#976]: https://github.com/ergebnis/php-cs-fixer-config/pull/976 [#977]: https://github.com/ergebnis/php-cs-fixer-config/pull/977 +[#978]: https://github.com/ergebnis/php-cs-fixer-config/pull/978 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index a2155138..e56067de 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index 49aeb724..42886803 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php55.php b/src/RuleSet/Php55.php index f542565c..5f74ebf0 100644 --- a/src/RuleSet/Php55.php +++ b/src/RuleSet/Php55.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php56.php b/src/RuleSet/Php56.php index 637e24bb..afb70061 100644 --- a/src/RuleSet/Php56.php +++ b/src/RuleSet/Php56.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php70.php b/src/RuleSet/Php70.php index 86592b85..0e90e764 100644 --- a/src/RuleSet/Php70.php +++ b/src/RuleSet/Php70.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index ea665e27..bd71f636 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index 757996ad..335d6ac9 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index 04711e85..b2ab5a0a 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index bc93aaf0..fc8388aa 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -36,6 +36,7 @@ public static function create(): RuleSet new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -53,6 +54,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 9fd968f8..f2472d80 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -37,6 +37,7 @@ public static function create(): RuleSet new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -58,6 +59,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 9de7c0b9..c7b403f3 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -37,6 +37,7 @@ public static function create(): RuleSet new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -58,6 +59,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index 0ee7741e..680a59b4 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -37,6 +37,7 @@ public static function create(): RuleSet new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -58,6 +59,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/src/RuleSet/Php83.php b/src/RuleSet/Php83.php index 655adc53..cd25e173 100644 --- a/src/RuleSet/Php83.php +++ b/src/RuleSet/Php83.php @@ -37,6 +37,7 @@ public static function create(): RuleSet new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -58,6 +59,7 @@ public static function create(): RuleSet 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php53Test.php b/test/Unit/RuleSet/Php53Test.php index 52b9ca47..175b6d45 100644 --- a/test/Unit/RuleSet/Php53Test.php +++ b/test/Unit/RuleSet/Php53Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php54Test.php b/test/Unit/RuleSet/Php54Test.php index d3a5e360..eed30eec 100644 --- a/test/Unit/RuleSet/Php54Test.php +++ b/test/Unit/RuleSet/Php54Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php55Test.php b/test/Unit/RuleSet/Php55Test.php index 0cec40cb..1790c479 100644 --- a/test/Unit/RuleSet/Php55Test.php +++ b/test/Unit/RuleSet/Php55Test.php @@ -42,6 +42,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php56Test.php b/test/Unit/RuleSet/Php56Test.php index b2d3424a..e6376fb4 100644 --- a/test/Unit/RuleSet/Php56Test.php +++ b/test/Unit/RuleSet/Php56Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php70Test.php b/test/Unit/RuleSet/Php70Test.php index 647fcb79..eb28c973 100644 --- a/test/Unit/RuleSet/Php70Test.php +++ b/test/Unit/RuleSet/Php70Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php71Test.php b/test/Unit/RuleSet/Php71Test.php index 7bf85746..96c85be6 100644 --- a/test/Unit/RuleSet/Php71Test.php +++ b/test/Unit/RuleSet/Php71Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php72Test.php b/test/Unit/RuleSet/Php72Test.php index 554c5a11..a5e952b9 100644 --- a/test/Unit/RuleSet/Php72Test.php +++ b/test/Unit/RuleSet/Php72Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index e9d63e27..4f127d7a 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 821e9b9a..e0b4df99 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -47,6 +47,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilineCommentOpeningClosingAloneFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -76,6 +77,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index b0798127..111e6d69 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -81,6 +82,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 6179fdeb..6ec4ad0f 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -81,6 +82,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index 53badfb8..dbef3602 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -81,6 +82,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [ diff --git a/test/Unit/RuleSet/Php83Test.php b/test/Unit/RuleSet/Php83Test.php index f68cf232..26abc106 100644 --- a/test/Unit/RuleSet/Php83Test.php +++ b/test/Unit/RuleSet/Php83Test.php @@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers new Fixer\MultilinePromotedPropertiesFixer(), new Fixer\NoDuplicatedArrayKeyFixer(), new Fixer\NoDuplicatedImportsFixer(), + new Fixer\NoImportFromGlobalNamespaceFixer(), new Fixer\PhpdocArrayStyleFixer(), new Fixer\PhpdocTypeListFixer(), new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), @@ -81,6 +82,7 @@ protected function expectedRules(): Rules 'ignore_expressions' => true, ], 'PhpCsFixerCustomFixers/no_duplicated_imports' => true, + 'PhpCsFixerCustomFixers/no_import_from_global_namespace' => true, 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'PhpCsFixerCustomFixers/phpdoc_type_list' => true, 'align_multiline_comment' => [