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

Disallow empty() since it is magic #37

Merged
merged 1 commit into from
Mar 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions consistence-coding-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ Expressions
* All keywords are lowercase, as well as `true`, `false` and `null`.
* Strict comparisons are used by default (`===`), if there is need for `==`, usually a comment should be given explaining situation.
* Magic PHP type conversions should be avoided - WRONG: `($foo)`, CORRECT: `($foo !== null)` - only expressions already containing boolean values should be written in `($foo)` form.
* The same applies for `empty` function, so it is forbidden.
* [Yoda conditions](http://en.wikipedia.org/wiki/Yoda_conditions) should not be used.
* If expression needs to be written on multiple lines, operators belong on the beginning of the line.

Expand Down