Skip to content

Commit c424648

Browse files
Update BC policy to tell about adding/removing return types
1 parent 3c88886 commit c424648

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contributing/code/bc.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ backward compatibility promise:
7373
+-----------------------------------------------+-----------------------------+
7474
| Add a default value to an argument | Yes |
7575
+-----------------------------------------------+-----------------------------+
76+
| Add a return type to an implemented method | Yes |
77+
+-----------------------------------------------+-----------------------------+
7678

7779
Using our Classes
7880
~~~~~~~~~~~~~~~~~
@@ -164,6 +166,8 @@ Remove default value of an argument No
164166
Add type hint to an argument No
165167
Remove type hint of an argument No
166168
Change argument type No
169+
Add return type No
170+
Remove return type No [9]_
167171
Change return type No
168172
**Constants**
169173
Add constant Yes
@@ -220,6 +224,8 @@ Remove default value of an argument No
220224
Add type hint to an argument No [7]_ [8]_
221225
Remove type hint of an argument No [7]_ [8]_
222226
Change argument type No [7]_ [8]_
227+
Add return type No [7]_ [8]_
228+
Remove return type No [7]_ [8]_ [9]_
223229
Change return type No [7]_ [8]_
224230
**Protected Methods**
225231
Add protected method Yes
@@ -235,6 +241,8 @@ Remove default value of an argument No [7]_
235241
Add type hint to an argument No [7]_ [8]_
236242
Remove type hint of an argument No [7]_ [8]_
237243
Change argument type No [7]_ [8]_
244+
Add return type No [7]_ [8]_
245+
Remove return type No [7]_ [8]_ [9]_
238246
Change return type No [7]_ [8]_
239247
**Private Methods**
240248
Add private method Yes
@@ -248,6 +256,8 @@ Remove default value of an argument Yes
248256
Add type hint to an argument Yes
249257
Remove type hint of an argument Yes
250258
Change argument type Yes
259+
Add return type Yes
260+
Remove return type Yes
251261
Change return type Yes
252262
**Static Methods**
253263
Turn non static into static No [7]_ [8]_
@@ -291,6 +301,8 @@ Change value of a constant Yes [1]_ [5]_
291301
Changing an argument type is only possible with a parent type.
292302
Changing a return type is only possible with a child type.
293303
304+
.. [9] Allowed for the ``void`` return type.
305+
294306
.. _Semantic Versioning: https://semver.org/
295307
.. _scalar type: https://php.net/manual/en/function.is-scalar.php
296308
.. _boolean values: https://php.net/manual/en/function.boolval.php

0 commit comments

Comments
 (0)