Skip to content

Commit d1e9207

Browse files
committed
Moved "conditions" inside "structure".
1 parent 55d0a69 commit d1e9207

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

contributing/code/standards.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ Structure
100100

101101
* Place unary operators (``!``, ``--``, ...) adjacent to the affected variable;
102102

103+
* Use `Yoda condition`_ when checking a variable against an expression to avoid
104+
an accidental assignment inside the condition statement;
105+
103106
* Add a comma after each array item in a multi-line array, even after the
104107
last one;
105108

@@ -167,24 +170,6 @@ Service Naming Conventions
167170

168171
* A group name uses the underscore notation.
169172

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-
188173
Documentation
189174
-------------
190175

0 commit comments

Comments
 (0)