-
Notifications
You must be signed in to change notification settings - Fork 28
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
Why is adding a protected/public method considered MAJOR? #48
Comments
Is that not adding them to an interface that's major? |
Hm no I just tested with latest version and I'm getting like a billion MAJOR warnings from methods added to all kinds of classes. |
Although that's the latest phar, let me test with master |
No yeah same thing with latest master. |
You can refer to the Ruleset for the current set of rules and their triggered level. Furthermore, it is possible to configure the triggered level via the Adding a <?php
class ChangedClass {
public function newMethod();
}
class ClassExtendingChangedClass extends ChangedClass {
public function newMethod();
} Here Thus, adding |
While I agree with the intent that is one hell of a constraint to follow in an actual project, how would you ever add a feature without adding any methods nor classes? If I had to tag a MAJOR everytime I added a protected method I'd be at version 512.0.0 or something :d |
@Anahkiasen Agreed. But that is what stability entails. I'm open to any suggestion that would make it more useful in other situations. Maybe have some sort of |
@tomzx I think, that I am going to disagree a bit with your justification on why adding a method is MAJOR. It's MAJOR only if it might be needed to extend your class which is ( in my impression ) not the general case for a library. But the only way to know that the class is not going to be extended is if it's marked as final. Maybe the rule should be updated with that difference in mind ? |
@mikeSimonson, I did plan/account for the final modifier (see Ruleset rules V017, V018, V021 & V022 for instance), but no code has been written to take it into account. I've rarely seen any library use it though (not a reason to do it, but only pointing that out). I've added #49, which should take care of adding final related rules. I'll complete the description of the issue when I have some time. |
@mikeSimonson Please go take a look at #49 and let me know what you think about the suggested rules. Thanks! |
Semver 2.0 says:
But currently PSC reports protected/public methods (or classes) added as a BC when I can't see why it would be. When one is removed yeah sure, but not added, no?
The text was updated successfully, but these errors were encountered: