Skip to content
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

Proposal: Enable global_namespace_import #36

Open
provokateurin opened this issue Sep 21, 2024 · 2 comments
Open

Proposal: Enable global_namespace_import #36

provokateurin opened this issue Sep 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@provokateurin
Copy link
Member

With configuration ['import_classes' => false, 'import_constants' => false, 'import_functions' => false]: https://cs.symfony.com/doc/rules/import/global_namespace_import.html#example-3

Main benefit for me would be exceptions, as it is a directly clear that a docblock like

/**
 * @throws Exception
 */

refers to \OCP\DB\Exception and not \Exception.
It would also safe some lines in the imports making them a bit more readable.

We could also switch it around, but I think we should settle on some configuration for this rule to have it the same everywhere.

@provokateurin provokateurin added the enhancement New feature or request label Sep 21, 2024
@nickvergessen
Copy link
Member

I agree that for global classes it's better readable/understandable if they are fully qualified inline

@blizzz
Copy link
Member

blizzz commented Oct 1, 2024

I am fine either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants