File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,29 @@ 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-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
+
80
103
.. _contributing-code-conventions-deprecations :
81
104
82
105
Deprecations
@@ -104,3 +127,5 @@ the migration starting one or two minor versions before the version where the
104
127
feature will be removed (depending on the criticality of the removal)::
105
128
106
129
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
You can’t perform that action at this time.
0 commit comments