File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ Structure
102
102
103
103
* Always use `identical comparison `_ unless you need type juggling;
104
104
105
+ * Use `Yoda conditions `_ when checking a variable against an expression to avoid
106
+ an accidental assignment inside the condition statement;
107
+
105
108
* Add a comma after each array item in a multi-line array, even after the
106
109
last one;
107
110
@@ -189,3 +192,4 @@ License
189
192
.. _`PSR-2` : http://www.php-fig.org/psr/psr-2/
190
193
.. _`PSR-4` : http://www.php-fig.org/psr/psr-4/
191
194
.. _`identical comparison` : https://php.net/manual/en/language.operators.comparison.php
195
+ .. _`Yoda conditions` : https://en.wikipedia.org/wiki/Yoda_conditions
You can’t perform that action at this time.
0 commit comments