Skip to content
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

Merged
merged 3 commits into from May 16, 2018
Merged

Deprecate polyfill function array_replace() #9056

merged 3 commits into from May 16, 2018

Conversation

michaelKaefer
Copy link
Contributor

@michaelKaefer michaelKaefer commented May 11, 2018

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)

Questions Answers
Branch? develop
Description? 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)
Type? improvement
Category? CO
BC breaks? no (but will log a message for every call of Tools::array_replace() function in production)
Deprecations? no
Fixed ticket? -
How to test? no additional tests needed

This change is Reviewable

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)
@prestonBot prestonBot added the develop Branch label May 11, 2018
*
* @return array|mixed|null
*/
public static function array_replace()
Copy link
Contributor

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 👍

Copy link
Contributor

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.

Copy link
Contributor Author

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?)

@mickaelandrieu mickaelandrieu added Improvement Type: Improvement Waiting for author Status: action required, waiting for author feedback labels May 12, 2018
@@ -779,14 +779,17 @@ public static function convertPrice($price, $currency = null, $to_currency = tru

return $price;
}

Copy link
Contributor

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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mickaelandrieu mickaelandrieu changed the title Remove polyfill function array_replace() Deprecate polyfill function array_replace() May 15, 2018
@mickaelandrieu mickaelandrieu removed the Waiting for author Status: action required, waiting for author feedback label May 15, 2018
@mickaelandrieu mickaelandrieu added this to the 1.7.5.0 milestone May 16, 2018
@mickaelandrieu mickaelandrieu merged commit b128bbc into PrestaShop:develop May 16, 2018
@mickaelandrieu
Copy link
Contributor

Thanks @michaelKaefer :)

@michaelKaefer michaelKaefer deleted the patch-2 branch May 16, 2018 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
develop Branch Improvement Type: Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants