User tests: Successful: Unsuccessful:
Fixes Deprecated: Automatic conversion of false to array is deprecated in libraries/vendor/joomla/uri/src/UriHelper.php on line 50
Pull Request for Issue # none, directly fix proposal.
Another PHP 8.1 warning fix.
Just review code would be enough as it's obvious PHP 8.1 issue and fix.
Open admin aera in PHP 8.1, find this warning.
Deprecated: Automatic conversion of false to array is deprecated in libraries/vendor/joomla/uri/src/UriHelper.php on line 50
Not that warning anymore.
none.
Status | New | ⇒ | Pending |
Category | ⇒ | External Library Libraries Composer Change |
Labels |
Added:
Composer Dependency Changed
?
?
|
I have tested this item
Code review.
I have tested this item white_check_mark successfully on 7f591bcCode review. Maybe not the most elegant way to fix it, having that check inside the loop, but it works and is safe and so ok for me.
Thank you @richard67 for the reviews and feedback. After 2nd thought, found and committed a way more elegant fix proposal.
Actually the function definition itself isn't elegant, as it's returning array|bool
. It could have returned an empty array instead of bool. But that was before PHP was moving to strict types.
The really elegant fix would be to change the API and return an empty array instead of bool false, and as as (bool) [] === false
it would be staying compatible, but would represent strictly an API change looking at the phpdoc bloc.
Actually the function definition itself isn't elegant, as it's returning
array|bool
. It could have returned an empty array instead of bool. But that was before PHP was moving to strict types.The really elegant fix would be to change the API and return an empty array instead of bool false, and as as
(bool) [] === false
it would be staying compatible, but would represent strictly an API change looking at the phpdoc bloc.
Yeah, we have to live with that mess, but as far as I know it shall be cleaned up with 5.0, and that will be next year. So there is light at the end of the tunnel (I hope it's not a train) :-)
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
This here is a change in a composer dependency so this PR should be send against the framework's 1.x branch from where we would take it back down to the CMS.
This here is a change in a composer dependency so this PR should be send against the framework's 1.x branch from where we would take it back down to the CMS.
Done here: joomla-framework/uri#30
Letting you merge and/or close this PR once the framework-PR is merged.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-01-23 20:35:01 |
Closed_By | ⇒ | Quy |
I have tested this item✅ successfully on 7f591bc
Code review. Maybe not the most elegant way to fix it, having that check inside the loop, but it works and is safe and so ok for me.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36774.