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
Deprecate polyfill function array_replace() #9056
Conversation
Remove polyfill function Tools::array_replace() for PHP versions <= 5.2 since PHP 5.2 is no longer supported (according to https://www.prestashop.com/en/system-requirements)
classes/Tools.php
Outdated
* | ||
* @return array|mixed|null | ||
*/ | ||
public static function array_replace() |
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.
we can deprecate it but not remove it: think about all modules that may use 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.
as you can see, we use it in core (but you remove this call in the next contribution) but we can't update every modules that comes from contributors.
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.
@mickaelandrieu Ok, made another commit, thank you! Just for my information: do deprecated functions stay in the codebase forever? I saw Symfony for example removes deprecated code (on major versions?)
classes/Tools.php
Outdated
@@ -779,14 +779,17 @@ public static function convertPrice($price, $currency = null, $to_currency = tru | |||
|
|||
return $price; | |||
} | |||
|
|||
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.
I have the feeling you have introduced some extra spaces here, isn't it?
*/ | ||
public static function array_replace() | ||
{ | ||
Tools::displayAsDeprecated('Use PHP\'s array_replace() instead'); |
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.
👍
Thanks @michaelKaefer :) |
Remove polyfill function Tools::array_replace() for PHP versions <= 5.2 since PHP 5.2 is no longer supported (according to https://www.prestashop.com/en/system-requirements)
This change is