Skip to content

[Fabbot] Add global_namespace_import PHPCSFixer rule #48002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Oct 26, 2022

Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

As suggested in #47709 (comment)

@carsonbot carsonbot added this to the 4.4 milestone Oct 26, 2022
@chalasr chalasr changed the title [Fabbot] Add global_namespace_import PHPCsFixer rule [Fabbot] Add global_namespace_import PHPCSFixer rule Oct 26, 2022
@stof
Copy link
Member

stof commented Oct 26, 2022

Isn't this already part of the @Symfony or @Symfony:risky rulesets ? This is a rule we have since years in the Symfony coding standards.

@chalasr
Copy link
Member Author

chalasr commented Oct 26, 2022

Nope https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/ruleSets/Symfony.rst.
Do you think it should? I tend to think it's fine to enable this one only on the core codebase.

@welcoMattic
Copy link
Member

It mentioned in https://symfony.com/doc/current/contributing/code/standards.html

Add a use statement for every class that is not part of the global namespace;

But not applied in https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/ruleSets/Symfony.rst?rgh-link-date=2022-10-26T12%3A10%3A34Z

I think we should fix the rule set instead of the core config

@chalasr
Copy link
Member Author

chalasr commented Oct 26, 2022

Works for me: PHP-CS-Fixer/PHP-CS-Fixer#6662

@chalasr chalasr closed this Oct 26, 2022
@chalasr chalasr deleted the global-ns-fabbot branch October 26, 2022 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants