Closed apphp closed 10 months ago
Q | A |
---|---|
Is bugfix? | ✔️/❌ |
New feature? | ✔️/❌ |
Breaks BC? | ✔️/❌ |
Tests pass? | ✔️/❌ |
Fixed issues | comma-separated list of tickets # fixed by the PR, if any |
getLanguageID
, getScriptID
, getTerritoryID
, and getLocaleDisplayName
) within the CLocale.php
are calling the getCanonicalID
method has been altered. Instead of using $this->
, they are now using self::
. This change makes the code's method calls more consistent and can potentially improve the overall performance of these functions.Thanks!
This change breaks BC: previously if you extend this class and override getCanonicalID()
, new implementation was used everywhere. After this change new implementation will be ignored and always CLocale::getCanonicalID()
will be used.
@rob006 Thank you for checking in detail, but that is not exactly the case. The method itself was not updated and was already static, and there are more function calls within the framework that were already calling it correctly using ::getCanonicalID()
@marcovtwout
Before change: https://3v4l.org/ZAIWn After change: https://3v4l.org/bM5Ka
I'm not sure if overwriting getCanonicalID()
is even supported, but $this->
could be used here to emulate static::
which was not available in older versions of PHP.
The old behavior (to my surprise) doesn't cause any PHP warning. Looking at the history, it doesn't look like $this was used on purpose, so I would say this change is fairly safe.