Skip to content

[Draft] Added detailed BC promise text #3438

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

Closed
wants to merge 1 commit into from

Conversation

webmozart
Copy link
Contributor

I created a detailed text about which parts of the Symfony code are covered by our BC promise. The goals are to:

  • tell our users which parts exactly are safe to use
  • tell our contributors which changes they are allowed to do

I'll continue working on the individual rules of allowed changes. Nevertheless, let me hear your feedback.

Remove default value of a parameter No No
Add type hint to a parameter No No
Remove type hint of a parameter Yes [1]_ No
Change return type Yes [1]_ No
Copy link
Member

Choose a reason for hiding this comment

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

changing the return type should be allowed only for compatible return values, to avoid breaking calling code, otherwise it is not safe to use anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I initially had a footnote for that there, but then you need to define which return values are "compatible". I couldn't really find a useful definition here.

Copy link
Contributor

Choose a reason for hiding this comment

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

if changing the return type is allowed, you can basically allow everything else as well. I would rather get a fatal error that a method signature is wrong, than having some nasty bugs because of changed return type, like array[0] is suddenly string[0].

@wouterj
Copy link
Member

wouterj commented Jan 7, 2014

fyi, this needs a rebase

@webmozart
Copy link
Contributor Author

Replaced by #3439 (correctly rebased onto 2.1 now).

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

Successfully merging this pull request may close these issues.

4 participants