Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Add guideline that changing default values is a BC break#21371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:6.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -136,6 +136,10 @@ covered by our backward compatibility promise: | ||
| +-----------------------------------------------+-----------------------------+ | ||
| | Add a default value to an argument | Yes | | ||
| +-----------------------------------------------+-----------------------------+ | ||
| | Change default value of an argument | No :ref:`[12] <note-12>` | | ||
| +-----------------------------------------------+-----------------------------+ | ||
| | Remove default value of an argument | No :ref:`[13] <note-13>` | | ||
| +-----------------------------------------------+-----------------------------+ | ||
Comment on lines +139 to +142 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The BC promise consist of 2 main sections:
Given this table is part of the first section, we should either revert both of them or change the first to "Yes" and revert the last one. | ||
| | Call a private method (via Reflection) | No | | ||
| +-----------------------------------------------+-----------------------------+ | ||
| | Access a private property (via Reflection) | No | | ||
| @@ -211,7 +215,8 @@ Add argument without a default value No | ||
| Add argument with a default value No | ||
| Remove argument No :ref:`[3] <note-3>` | ||
| Add default value to an argument No | ||
| Change default value of an argument No :ref:`[12] <note-12>` | ||
| Remove default value of an argument No :ref:`[13] <note-13>` | ||
| Add type hint to an argument No | ||
| Remove type hint of an argument No | ||
| Change argument type No | ||
| @@ -264,7 +269,8 @@ Add constructor without mandatory arguments Yes | ||
| Add argument with a default value Yes :ref:`[11] <note-11>` | ||
| Remove argument No :ref:`[3] <note-3>` | ||
| Add default value to an argument Yes | ||
| Change default value of an argument No :ref:`[12] <note-12>` | ||
| Remove default value of an argument No :ref:`[13] <note-13>` | ||
| Add type hint to an argument No | ||
| Remove type hint of an argument Yes | ||
| Change argument type No | ||
| @@ -288,7 +294,7 @@ Move to parent class Yes | ||
| Rename argument Yes :ref:`[10] <note-10>` | ||
| Remove argument No :ref:`[3] <note-3>` | ||
| Add default value to an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| Remove default value of an argument No :ref:`[13] <note-13>` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is there a reason not to add "Change default value of an argument No" here and for protected methods below? | ||
| Add type hint to an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| Remove type hint of an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| Change argument type No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| @@ -308,7 +314,7 @@ Move to parent class Yes | ||
| Rename argument Yes :ref:`[10] <note-10>` | ||
| Remove argument No :ref:`[3] <note-3>` | ||
| Add default value to an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| Remove default value of an argument No :ref:`[13] <note-13>` :ref:`[7] <note-7>` | ||
| Add type hint to an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| Remove type hint of an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| Change argument type No :ref:`[7] <note-7>` :ref:`[8] <note-8>` | ||
| @@ -382,7 +388,7 @@ Move to used trait | ||
| :ref:`Add argument with a default value <add-argument-public-method>` No | ||
| Remove argument No | ||
| Add default value to an argument No | ||
| Remove default value of an argument No :ref:`[13] <note-13>` | ||
| Add type hint to an argument No | ||
| Remove type hint of an argument No | ||
| Change argument type No | ||
| @@ -399,7 +405,7 @@ Move to used trait | ||
| :ref:`Add argument with a default value <add-argument-public-method>` No | ||
| Remove argument No | ||
| Add default value to an argument No | ||
| Remove default value of an argument No :ref:`[13] <note-13>` | ||
| Add type hint to an argument No | ||
| Remove type hint of an argument No | ||
| Change argument type No | ||
| @@ -414,7 +420,7 @@ Add argument without a default value | ||
| Add argument with a default value No | ||
| Remove argument No | ||
| Add default value to an argument No | ||
| Remove default value of an argument No :ref:`[13] <note-13>` | ||
| Add type hint to an argument No | ||
| Remove type hint of an argument No | ||
| Change argument type No | ||
| @@ -490,6 +496,16 @@ code when upgrading to newer Symfony versions. | ||
| **[11]** Only optional argument(s) of a constructor at last position may be added. | ||
| .. _note-12: | ||
| **[12]** Changing a default value is a BC break because it changes the behavior | ||
| of existing code that relies on the current default value. | ||
| .. _note-13: | ||
| **[13]** Removing a default value is a BC break because it makes previously | ||
| optional arguments required, breaking existing code that doesn't pass all arguments. | ||
| Making Code Changes in a Backward Compatible Way | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||