File tree Expand file tree Collapse file tree 2 files changed +26
-27
lines changed Expand file tree Collapse file tree 2 files changed +26
-27
lines changed Original file line number Diff line number Diff line change @@ -77,31 +77,6 @@ must be used instead (where ``XXX`` is the name of the related thing):
77
77
"replaceXXX", on the other hand, cannot add new elements. If an unrecognized
78
78
key is passed to "replaceXXX" it must throw an exception.
79
79
80
- .. _contributing-code-conventions-conditions :
81
-
82
- Conditions
83
- ----------
84
-
85
- Use `Yoda condition `_ when you need to check a variable against a value.
86
- The main goal with this syntax is to avoid an accidental assignment inside the
87
- condition statements:
88
-
89
- instead of:
90
-
91
- .. code-block :: php
92
-
93
- if ($someVar === 'some string' && $otherVar === someFunction()) {
94
- // ...
95
- }
96
-
97
- it should be:
98
-
99
- .. code-block :: php
100
-
101
- if ('some string' === $someVar && someFunction() === $otherVar) {
102
- // ...
103
- }
104
-
105
80
.. _contributing-code-conventions-deprecations :
106
81
107
82
Deprecations
@@ -129,5 +104,3 @@ the migration starting one or two minor versions before the version where the
129
104
feature will be removed (depending on the criticality of the removal)::
130
105
131
106
trigger_error('XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.', E_USER_DEPRECATED);
132
-
133
- .. _`Yoda condition` : https://en.wikipedia.org/wiki/Yoda_conditions
Original file line number Diff line number Diff line change @@ -167,6 +167,31 @@ Service Naming Conventions
167
167
168
168
* A group name uses the underscore notation.
169
169
170
+ .. _contributing-code-standards-conditions :
171
+
172
+ Conditions
173
+ ----------
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:
178
+
179
+ instead of:
180
+
181
+ .. code-block :: php
182
+
183
+ if ($someVar === 'some string' && $otherVar === someFunction()) {
184
+ // ...
185
+ }
186
+
187
+ it should be:
188
+
189
+ .. code-block :: php
190
+
191
+ if ('some string' === $someVar && someFunction() === $otherVar) {
192
+ // ...
193
+ }
194
+
170
195
Documentation
171
196
-------------
172
197
@@ -186,3 +211,4 @@ License
186
211
.. _`PSR-1` : http://www.php-fig.org/psr/psr-1/
187
212
.. _`PSR-2` : http://www.php-fig.org/psr/psr-2/
188
213
.. _`PSR-4` : http://www.php-fig.org/psr/psr-4/
214
+ .. _`Yoda condition` : https://en.wikipedia.org/wiki/Yoda_conditions
You can’t perform that action at this time.
0 commit comments