-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
BC promise doesn't care about constants #5224
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
Comments
Constants are public in PHP, so they cannot be removed |
Agree, what do you think about adding this into the "Changing Interfaces/Classes" tables in the BC promise page? |
@dosten sounds good to me. Can you send a PR to improve it ? |
👍 |
Yes, of course |
Before sending a PR i want to be sure about the changes allowed.
Adding a constant to a API class/interface must be allowed? |
@dosten I would say:
/cc @fabpot @webmozart |
@wouterj I'm not sure about allow to change the value of a constant in a normal class/interface. |
ping @fabpot @webmozart |
Changing the value of the constant depends of what the goal of the constant is. In most cases, it is not allowed. But we have a constant in the Yaml component providing a regex IIRC, and changing the value to fix a bug in the regex would be allowed for instance |
So, we can allow to change the value of a constant in a regular or API class/interface with a footnote? |
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #5672). Discussion ---------- Add constants to BC promise | Q | A | --- | --- | Doc fix? | no | New docs? | yes | Applies to | all | Fixed tickets | #5224 This does things a little bit different than proposed in #5224, based on [this comment by @fabpot](symfony/symfony#15680 (comment)) and the fact that one uses constants, to allow to change the value without breaking the code. /cc @webmozart @stof @weaverryan @xabbuh please review this & give your opinion on this. Commits ------- d25c28d Add constants to BC promise
Closing it as fixed by #5672. |
Searching in the BC promise i don't find any information about the removal, etc of a constant in a normal or API class. Ex: In symfony/symfony#14531 the
PATTERN
constant it's not necessarry but i don't know if i can remove it since the class is tagged as@api
.The text was updated successfully, but these errors were encountered: