Skip to content

Commit 885def0

Browse files
committed
Add constants to BC promise
1 parent 3b2f4d0 commit 885def0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

contributing/code/bc.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ Add type hint to an argument No
169169
Remove type hint of an argument No
170170
Change argument type No
171171
Change return type No
172+
**Constants**
173+
Add constant Yes
174+
Remove constant No
175+
Change value of a constant Yes [1]_ [5]_
172176
============================================== ==============
173177

174178
Changing Classes
@@ -253,6 +257,10 @@ Change return type Yes
253257
**Static Methods**
254258
Turn non static into static No
255259
Turn static into non static No
260+
**Constants**
261+
Add constant Yes
262+
Remove constant No
263+
Change value of a constant Yes [1]_ [5]_
256264
================================================== ==============
257265

258266
.. [1] Should be avoided. When done, this change must be documented in the
@@ -267,6 +275,13 @@ Turn static into non static No
267275
.. [4] When changing the parent class, the original parent class must remain an
268276
ancestor of the class.
269277
278+
.. [5] The value of a constant may only be changed when the constants aren't
279+
used in configuration (e.g. Yaml and XML files), as these do not support
280+
constants and have to hardcode the value. For instance, event name
281+
constants can't change the value without introducing a BC break.
282+
Additionally, if a constant will likely be used in objects that are
283+
serialized, the value of a constant should not be changed.
284+
270285
.. _Semantic Versioning: http://semver.org/
271286
.. _scalar type: http://php.net/manual/en/function.is-scalar.php
272287
.. _boolean values: http://php.net/manual/en/function.boolval.php

0 commit comments

Comments
 (0)