Skip to content

Commit 036261c

Browse files
committed
Moved strict comparison doc from conventions to standards.
1 parent b0055ed commit 036261c

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

contributing/code/conventions.rst

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,6 @@ must be used instead (where ``XXX`` is the name of the related thing):
7777
"replaceXXX", on the other hand, cannot add new elements. If an unrecognized
7878
key is passed to "replaceXXX" it must throw an exception.
7979

80-
.. _contributing-code-conventions-comparisons:
81-
82-
Comparisons
83-
-----------
84-
85-
Use `identical comparison`_ when the expected value must match a specific type:
86-
87-
instead of:
88-
89-
.. code-block:: php
90-
91-
if (1 == $integerExpected) {
92-
// ...
93-
}
94-
95-
it should be:
96-
97-
.. code-block:: php
98-
99-
if (1 === $integerExpected) {
100-
// ...
101-
}
102-
10380
.. _contributing-code-conventions-deprecations:
10481

10582
Deprecations
@@ -127,5 +104,3 @@ the migration starting one or two minor versions before the version where the
127104
feature will be removed (depending on the criticality of the removal)::
128105

129106
trigger_error('XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.', E_USER_DEPRECATED);
130-
131-
.. _`identical comparison`: https://php.net/manual/en/language.operators.comparison.php

contributing/code/standards.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,29 @@ Service Naming Conventions
167167

168168
* A group name uses the underscore notation.
169169

170+
.. _contributing-code-standards-comparisons:
171+
172+
Comparisons
173+
-----------
174+
175+
Use `identical comparison`_ when the expected value must match a specific type:
176+
177+
instead of:
178+
179+
.. code-block:: php
180+
181+
if (1 == $integerExpected) {
182+
// ...
183+
}
184+
185+
it should be:
186+
187+
.. code-block:: php
188+
189+
if (1 === $integerExpected) {
190+
// ...
191+
}
192+
170193
Documentation
171194
-------------
172195

@@ -186,3 +209,4 @@ License
186209
.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/
187210
.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/
188211
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
212+
.. _`identical comparison`: https://php.net/manual/en/language.operators.comparison.php

0 commit comments

Comments
 (0)