File tree 1 file changed +3
-18
lines changed
1 file changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ Structure
100
100
101
101
* Place unary operators (``! ``, ``-- ``, ...) adjacent to the affected variable;
102
102
103
+ * Use `Yoda condition `_ when checking a variable against an expression to avoid
104
+ an accidental assignment inside the condition statement;
105
+
103
106
* Add a comma after each array item in a multi-line array, even after the
104
107
last one;
105
108
@@ -167,24 +170,6 @@ Service Naming Conventions
167
170
168
171
* A group name uses the underscore notation.
169
172
170
- .. _contributing-code-standards-conditions :
171
-
172
- Conditions
173
- ----------
174
-
175
- Use `Yoda condition `_ when checking a variable against a value to avoid an
176
- accidental assignment inside the condition statements::
177
-
178
- // use
179
- if ('some string' === $someVar && someFunction() === $otherVar) {
180
- // ...
181
- }
182
-
183
- // instead of
184
- if ($someVar === 'some string' && $otherVar === someFunction()) {
185
- // ...
186
- }
187
-
188
173
Documentation
189
174
-------------
190
175
You can’t perform that action at this time.
0 commit comments