Skip to content

Commit 075caa1

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: Add BC promise rules for constructors
2 parents f55c0a8 + 0124dd0 commit 075caa1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contributing/code/bc.rst

+12
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,14 @@ Make public or protected Yes
253253
Remove private property Yes
254254
**Constructors**
255255
Add constructor without mandatory arguments Yes :ref:`[1] <note-1>`
256+
:ref:`Add argument without a default value <add-argument-public-method>` No
257+
Add argument with a default value Yes :ref:`[11] <note-11>`
258+
Remove argument No :ref:`[3] <note-3>`
259+
Add default value to an argument Yes
260+
Remove default value of an argument No
261+
Add type hint to an argument No
262+
Remove type hint of an argument Yes
263+
Change argument type No
256264
Remove constructor No
257265
Reduce visibility of a public constructor No
258266
Reduce visibility of a protected constructor No :ref:`[7] <note-7>`
@@ -468,6 +476,10 @@ a return type is only possible with a child type.
468476
constructors of Attribute classes. Using PHP named arguments might break your
469477
code when upgrading to newer Symfony versions.
470478

479+
.. _note-11:
480+
481+
**[11]** Only optional argument(s) of a constructor at last position may be added.
482+
471483
Making Code Changes in a Backward Compatible Way
472484
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
473485

0 commit comments

Comments
 (0)