-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[3.0][Translator] changed the visibility of the locale from protected to private. #14693
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
Conversation
aitboudad
commented
May 19, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | yes |
Deprecations? | yes |
Fixed tickets | ~ |
Tests pass? | yes |
License | MIT |
Thats something users will have to find in the |
@mpdude Not sure if there is a way to deprecate protected property the only thing came to my mind is to add a note in |
There's a way but you won't like it. Implement |
@iltar no it won't work as expected, the |
The question is what the "Symfony standard way" of doing this looks like. |
Does this BC break really add a value to the codebase? I mean, is it really worth it to take the risk of breaking applications / libraries relying on this |
ping @symfony/deciders |
1eb844a
to
9895c3d
Compare
and given that we added validations of invalid locales to avoid a security issue, forcing to go through the setter to update it seems logical to me. 👍 |
*/ | ||
public function setLocale($locale) | ||
{ | ||
$this->locale = $locale; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this tests? a custom translator can still return an invalid locale if it overwrites getLocale
instead (or getLocale and setLocale).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted
I'm 👍 given that it usually doesn't make sense to make properties protected when there are public getters/setters also defined. There is no point it creating 2 extension points, esp. when it's security related. |
9895c3d
to
94de779
Compare
👍 |
Thank you @aitboudad. |
… from protected to private. (aitboudad) This PR was merged into the 3.0-dev branch. Discussion ---------- [3.0][Translator] changed the visibility of the locale from protected to private. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | yes | Fixed tickets | ~ | Tests pass? | yes | License | MIT Commits ------- 94de779 [Translator] changed the visibility of the locale from protected to private.