yiisoft / yii

Yii PHP Framework 1.1.x
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
4.84k stars 2.28k forks source link

Fix PHP 8.1 deprecation errors #4503

Closed wtommyw closed 1 year ago

wtommyw commented 1 year ago

Re-enabled deprecation errors in tests and fixed them.

Main fixes:

Q A
Is bugfix?
New feature?
Breaks BC?
Tests pass? ✔️
Fixed issues #4506
wtommyw commented 1 year ago

@marcovtwout @rob006 I tried to request a re-review on both of you, but it looks like Github does not allowe this. I'm unsure if anyon's got the ping now

marcovtwout commented 1 year ago

@wtommyw After https://github.com/yiisoft/yii/pull/4503/files#r1055466147, feel free to add a changelog line with something like : "Enh 4503: Update tests/code for PHP 8.1 compatibility and stop suppressing deprecation warnings"

wtommyw commented 1 year ago

I still think that cast in getCanonicalID is unnecessary and null should be handled in getLocaleDisplayName() https://github.com/yiisoft/yii/pull/4503/files#r1055466147

@rob006 I agree, I've made the change. This way we'll actually follow the documented behaviour (not passing null into getCanonicalID.