Skip to content

Commit 55d0a69

Browse files
committed
Updated Yoda condition caption as suggested by Javier Eguiluz.
1 parent e1bcab0 commit 55d0a69

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

contributing/code/standards.rst

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,23 +172,16 @@ Service Naming Conventions
172172
Conditions
173173
----------
174174

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::
178177

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) {
184180
// ...
185181
}
186182

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()) {
192185
// ...
193186
}
194187

0 commit comments

Comments
 (0)