Skip to content

Update BC policy to tell about adding/removing return types #9717

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
May 15, 2018

Conversation

nicolas-grekas
Copy link
Member

Fixes #8609

@@ -291,6 +301,8 @@ Change value of a constant Yes [1]_ [5]_
Changing an argument type is only possible with a parent type.
Changing a return type is only possible with a child type.

.. [9] Allowed for the ``void`` return type.
Copy link
Member

Choose a reason for hiding this comment

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

Are you saying that void is an exception then? That, for example, adding/removing a return type would be a BC break... except for void?

Copy link
Member Author

@nicolas-grekas nicolas-grekas May 2, 2018

Choose a reason for hiding this comment

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

Yes, that's what I mean. Technically, PHP allows removing the return type without breaking children. But doing so would allow breaking contracts. Except for void.

@xabbuh xabbuh added this to the 2.7 milestone May 6, 2018
@javiereguiluz
Copy link
Member

Thanks Nicolas.

@javiereguiluz javiereguiluz merged commit c424648 into symfony:2.7 May 15, 2018
javiereguiluz added a commit that referenced this pull request May 15, 2018
…es (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

Update BC policy to tell about adding/removing return types

Fixes #8609

Commits
-------

c424648 Update BC policy to tell about adding/removing return types
@nicolas-grekas nicolas-grekas deleted the return-type branch July 1, 2018 20:44
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.

7 participants