Skip to content

Conversation

OskarStark
Copy link
Contributor

No description provided.

@OskarStark OskarStark self-assigned this Sep 13, 2025
@carsonbot carsonbot added this to the 6.4 milestone Sep 13, 2025
@carsonbot carsonbot changed the title Add guideline that changing default values is a BC break Add guideline that changing default values is a BC break Sep 13, 2025
@OskarStark OskarStark requested a review from fabpot September 13, 2025 09:37
Comment on lines +139 to +142
| Change default value of an argument | No :ref:`[12] <note-12>` |
+-----------------------------------------------+-----------------------------+
| Remove default value of an argument | No :ref:`[13] <note-13>` |
+-----------------------------------------------+-----------------------------+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BC promise consist of 2 main sections:

  • The first part is "Using Symfony Code", here we explain "if you use an interface/class from Symfony and do this, you can expect your code to keep working"
  • The second part is "Working on Symfony Code", where we explain which changes we and our contributors are allowed to make to Symfony interfaces/classes.

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.
If you change the default value when implementing an interface, no change in the interface will break your code. So it's OK to change the default value.
And removing a default value while the interface has a default value is not possible in PHP.

@@ -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
Remove default value of an argument No :ref:`[13] <note-13>`
Copy link
Member

Choose a reason for hiding this comment

The 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants