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

refactors to use '||' and '&&' instead of 'and' and 'or' operators #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ordago
Copy link
Contributor

@ordago ordago commented Jun 18, 2024

This is a suggestion for code style that doesn't affect the logic of the methods.

While they're not part of PSR recommendations, others still suggest not using the or and and boolean operators.

https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/operator/logical_operators.rst

(the rule could be added to csfixer)

They can have less intuitive behaviour. e.g.:

$a = TRUE && FALSE; //false
$b = TRUE and FALSE;  //true

demo: https://onlinephp.io/c/b8e62

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

Successfully merging this pull request may close these issues.

1 participant