-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[RFC] Clarification on formatting for bangs (!) #4457
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
Changes from 4 commits
7077a54
bb51e3b
75c4fc2
9736b15
119d94e
87279d2
c2fa7db
ccc99e6
de4c018
d7949fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,14 +79,25 @@ example containing most features described below: | |
|
||
throw new \RuntimeException(sprintf('Unrecognized dummy option "%s"', $dummy)); | ||
} | ||
|
||
private function reverseBoolean($value = null) | ||
{ | ||
if (!isset($value)) { | ||
return; | ||
} | ||
return !$value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing empty line above |
||
} | ||
} | ||
|
||
Structure | ||
--------- | ||
|
||
* Add a single space after each comma delimiter; | ||
|
||
* Add a single space around operators (``==``, ``&&``, ...); | ||
* Add a single space around operators (``==``, ``&&``, ...), with the excption | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exception |
||
of the not (!) operator; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put the |
||
|
||
* Place the not operator adjacent to the variable that it affects | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a semicolon at the end of the sentence. |
||
|
||
* Add a comma after each array item in a multi-line array, even after the | ||
last one; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$value is always set. So this is a redundant check.
if (!$value)
would be against the CS, so I propose to add another switch which defaults to false or the like to do something else and then useif (!$theSwitch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, we never use
!isset($value)
to check fornull
, butnull === $value