-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Static call TimezoneType::getTimezones #23652
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
Seems like you've made fabbot unhappy though. It has feelings you know. |
@@ -66,7 +66,7 @@ public function loadChoiceList($value = null) | |||
return $this->choiceList; | |||
} | |||
|
|||
return $this->choiceList = new ArrayChoiceList($this->getTimezones(), $value); | |||
return $this->choiceList = new ArrayChoiceList(self::getTimezones(), $value); |
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.
Technically, the previous code allowed extending the class to provide alternative implem via inheritance. Was it on purpose? Can't say right now, but that should be considered before approval.
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.
As of 3.0 getTimezones is a private static.. so not open for inheritance :)
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.
ok, strange, but verified: https://3v4l.org/n61o4
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.
Ah like so.. you're right i didnt checked it.. i assumed it :)
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.
OH, but you can turn it protected, so still open for extension!
https://3v4l.org/f2STp
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.
Right. I cant imagine this is done on purpose.. at least core doesnt seem to rely on it elsewhere.
Nice catch btw :)
Thanks @ro0NL. |
This PR was merged into the 3.2 branch. Discussion ---------- [Form] Static call TimezoneType::getTimezones | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> Spotted in #23648 Commits ------- fe48ab1 [Form] Static call TimezoneType::getTimezones
Spotted in #23648