-
Notifications
You must be signed in to change notification settings - Fork 160
Added deprecated function PHP 8.1 to DiscouragedFunctionSniff #326
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
Added deprecated function PHP 8.1 to DiscouragedFunctionSniff #326
Conversation
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 for the pull request @anzin ! Please see my comment
'^date_sunrise$' => 'date_sun_info', | ||
'^date_sunset$' => 'date_sun_info', | ||
'^strptime$' => 'date_parse_from_format', | ||
'^strftime$' => null, |
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.
It would be great to add replacement recommendations for each of the deprecated functions. For example for this function:
'^strftime$' => null, | |
'^strftime$' => 'IntlDateFormatter::format()', |
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.
Even though the replacement can be more complex than just a single function call, like in this case
setlocale(LC_ALL, 'nl_NL');
$formatter = new IntlDateFormatter(\Locale::getDefault(), IntlDateFormatter::FULL, IntlDateFormatter::FULL);
$formatter->setPattern('EEEE, LLLL d');
echo $formatter->format(new DateTime());
I think the replacement suggestion should at least help the developer with the research direction.
89e33f2
to
ef8bd3f
Compare
Hello @sivaschenko, I added some replacement recommendations, please check if every. |
@magento import pr to magento-commerce/magento-coding-standard |
@sivaschenko an error occurred during the Pull Request import. |
Description (*)
Added deprecated function PHP 8.1 to DiscouragedFunctionSniff
Addresses backward incompatible change in PHP 8.1: https://wiki.php.net/rfc/deprecations_php_8_1
Fixed Issues (if relevant)
Magento2.Functions.DiscouragedFunction
of themagento-coding-standard
magento2#34548Contribution checklist (*)