Proposal: Enable `global_namespace_import`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Review the linked global_namespace_import documentation, especially example 3, then inspect the repository’s existing PHP-CS-Fixer configuration. Decide whether to enable it with import_classes, import_constants, and import_functions disabled, or adopt the alternative consistently; done means one agreed configuration is applied throughout.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- PHP
- Stars
- 14
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/coding-standard
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
nextcloud/coding-standard#48 · 4 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
nextcloud/coding-standard#47 · 1 comment ·
-
enhancement question
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
nextcloud/coding-standard#42 · 2 comments · 2 reactions ·
-
enhancement question
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
nextcloud/coding-standard#41 · 1 comment · 3 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
nextcloud/coding-standard#39 · 1 comment · 1 reaction ·
All issues in nextcloud/coding-standard
Similar issues
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·