Skip to content

Commit

Permalink
Moved strict comparison doc from conventions to standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Jun 15, 2015
1 parent b0055ed commit 036261c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
25 changes: 0 additions & 25 deletions contributing/code/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,6 @@ must be used instead (where ``XXX`` is the name of the related thing):
"replaceXXX", on the other hand, cannot add new elements. If an unrecognized
key is passed to "replaceXXX" it must throw an exception.

.. _contributing-code-conventions-comparisons:

Comparisons
-----------

Use `identical comparison`_ when the expected value must match a specific type:

instead of:

.. code-block:: php
if (1 == $integerExpected) {
// ...
}
it should be:

.. code-block:: php
if (1 === $integerExpected) {
// ...
}
.. _contributing-code-conventions-deprecations:

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

trigger_error('XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.', E_USER_DEPRECATED);

.. _`identical comparison`: https://php.net/manual/en/language.operators.comparison.php
24 changes: 24 additions & 0 deletions contributing/code/standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,29 @@ Service Naming Conventions

* A group name uses the underscore notation.

.. _contributing-code-standards-comparisons:

Comparisons
-----------

Use `identical comparison`_ when the expected value must match a specific type:

instead of:

.. code-block:: php
if (1 == $integerExpected) {
// ...
}
it should be:

.. code-block:: php
if (1 === $integerExpected) {
// ...
}
Documentation
-------------

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

0 comments on commit 036261c

Please sign in to comment.