Skip to content

Commit

Permalink
Merge pull request #978 from ergebnis/feature/no-import-from-global-n…
Browse files Browse the repository at this point in the history
…amespace

Enhancement: Enable `PhpCsFixerCustomFixers/no_import_from_global_namespace` fixer
  • Loading branch information
localheinz authored Jan 4, 2024
2 parents 80a763c + 5245631 commit 063eecc
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php53.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php82.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/Php83.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php53Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php54Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php55Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php56Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php70Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php71Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions test/Unit/RuleSet/Php72Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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' => [
Expand Down
Loading

0 comments on commit 063eecc

Please sign in to comment.