-
Notifications
You must be signed in to change notification settings - Fork 59
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
Adding a public method on a non-final class is to be considered a BC break #111
Comments
It's technically correct, but IMO way too pedantic. 🤔 |
Still gonna add it to the default set with a new major: I'll tackle #52 as well. It is true that these are pedantic, but I'm really just trying to categorise the BC breaks here, not saying this will fit for everyone 👍 |
Hmm, previous comment got lost due to timeouts. Wanted to clarify that I'm just categorising and enabling BC breaks as they are discovered/remembered (this one was long known, just forgotten), even if they are extremely strict, so this will appear in the defaults for the next major. I'll try to tackle #52 before implementing this. |
In case you need a real world example that crashed a lot of things: yiisoft/yii2#14441 (comment) ;) |
We also have one in Doctrine: EntityRepository::count() with different signature than the one that comes from Countable, broke a lot of stuff in userland for people who implemented Countable (which doesn't make much sense, but anyway). |
as @Majkl578 said, adding bc breaks in this case is correct but a bit pedantic. |
great |
Moving out of 3.0.0: won't get to it for now. |
Not going to be able to drag this into |
Take following example:
If
Counter
is modified to add anincrement2
method,LoggingCounter
fails (this is partly described in my article "When to declare Classes Final" ).Here's a test to show that:
This is because decorators require an update for each parent class public API change. Therefore, we should mark any addition of methods to an open class as a BC break.
The text was updated successfully, but these errors were encountered: