Proposal use `logical_operators`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the linked logical_operators rule documentation and the PHP operator-precedence reference. Determine whether this belongs in the coding-standard rule set or should instead be a Psalm rule, then review the repository's existing rule configuration and tests. Done means the chosen approach consistently addresses uses of and and or without introducing precedence-related breakage.
Written by the indexing model from the issue text.
Description
Forbid using and and or operators in favor of && and ||.
The reason is that and and or have non obvious different precedence, which also makes this rule risky thus we might need to discuss if we instead need to create a psalm rule for it.
See also https://www.php.net/manual/en/language.operators.precedence.php
- if ($foo and $bar)
+ if ($foo && bar)
cc @nickvergessen @provokateurin @ChristophWurst
- 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
-
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 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
nextcloud/coding-standard#36 · 2 comments · 2 reactions ·
All issues in nextcloud/coding-standard
Similar issues
-
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 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100