File tree 1 file changed +6
-13
lines changed
1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -172,23 +172,16 @@ Service Naming Conventions
172
172
Conditions
173
173
----------
174
174
175
- Use `Yoda condition `_ when you need to check a variable against a value.
176
- The main goal with this syntax is to avoid an accidental assignment inside the
177
- condition statements:
175
+ Use `Yoda condition `_ when checking a variable against a value to avoid an
176
+ accidental assignment inside the condition statements::
178
177
179
- instead of:
180
-
181
- .. code-block :: php
182
-
183
- if ($someVar === 'some string' && $otherVar === someFunction()) {
178
+ // use
179
+ if ('some string' === $someVar && someFunction() === $otherVar) {
184
180
// ...
185
181
}
186
182
187
- it should be:
188
-
189
- .. code-block :: php
190
-
191
- if ('some string' === $someVar && someFunction() === $otherVar) {
183
+ // instead of
184
+ if ($someVar === 'some string' && $otherVar === someFunction()) {
192
185
// ...
193
186
}
194
187
You can’t perform that action at this time.
0 commit comments