Skip to content

BC promise: only optional arguments can be removed #12606

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2019

Conversation

teohhanhui
Copy link
Contributor

@teohhanhui teohhanhui commented Nov 8, 2019

Fixes symfony/symfony#34230 (comment)

I've changed Yes to No, since it makes more sense, i.e. it's not allowed, unless...

Additional question: Should I also change No to No [3]_ for traits? Or is there a specific reason why it's absolutely not allowed on traits?

@OskarStark
Copy link
Contributor

@nicolas-grekas may we have your 2 cents here? Thanks 😊

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

With one minor suggestion

@teohhanhui
Copy link
Contributor Author

What about this point?

Additional question: Should I also change No to No [3]_ for traits? Or is there a specific reason why it's absolutely not allowed on traits?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 15, 2019

Is there a specific reason why it's absolutely not allowed on traits?

A trait is not part of a type, thus we don't know what contract it implements: maybe an interface/the parent of the class that uses the trait actually declared the optional argument. Removing it would be a BC break. Since we cannot know, we cannot remove these arguments.

@teohhanhui
Copy link
Contributor Author

teohhanhui commented Nov 16, 2019

Should we add a note to explain this? Probably in another PR...

@wouterj
Copy link
Member

wouterj commented Nov 23, 2019

Thanks for updating this guide! Let's keep it like this for now. If there is confusion about traits in the core contributions, we can always elaborate in this guide.

wouterj added a commit that referenced this pull request Nov 23, 2019
…hanhui)

This PR was merged into the 3.4 branch.

Discussion
----------

BC promise: only optional arguments can be removed

Fixes symfony/symfony#34230 (comment)

I've changed `Yes` to `No`, since it makes more sense, i.e. it's not allowed, unless...

Additional question: Should I also change `No` to `No [3]_` for traits? Or is there a specific reason why it's absolutely not allowed on traits?

Commits
-------

ef477e3 BC promise: only optional arguments can be removed
@wouterj wouterj merged commit ef477e3 into symfony:3.4 Nov 23, 2019
@teohhanhui teohhanhui deleted the patch-1 branch November 23, 2019 12:51
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.

6 participants