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
Apply Rector suggestions for PHP 8.1 #41253
Conversation
Test Results SummaryCommit SHA: ea65150
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
a5c4ea0
to
2a86074
Compare
Hi @coreymckrill, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
2a86074
to
b53e0e2
Compare
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.
@asumaran, thanks for working on this. I've made some notes on the changes. A lot of these are false positives that should be fine with PHP8 given the context where they are used. I think it's better to keep the code clean here rather than add the extra checks.
plugins/woocommerce/includes/admin/importers/views/html-csv-import-done.php
Outdated
Show resolved
Hide resolved
plugins/woocommerce/includes/class-wc-deprecated-action-hooks.php
Outdated
Show resolved
Hide resolved
84cf710
to
318fe82
Compare
@prettyboymp E2E tests seem to fail for unrelated reasons. I've tried running them locally and the results are inconsistent. Edit: I'm investigating if failing tests are actually legit |
@prettyboymp I've fixed all test and lint issues. I think this is ready for a second look. |
plugins/woocommerce/includes/admin/meta-boxes/views/html-order-refund.php
Outdated
Show resolved
Hide resolved
plugins/woocommerce/includes/admin/settings/class-wc-settings-payment-gateways.php
Outdated
Show resolved
Hide resolved
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.
Changes look good. May need to change the changelog entry though.
01ffbb0
to
97d29e2
Compare
871605a
to
bfffbd7
Compare
Looks like CI is stuck. I'm going to close and re-open this to see if that fixes it. |
4869887
to
384f67e
Compare
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.
👍 Looks good to me. is_countable
is available starting in PHP 7.3, so meets WC's minimum PHP version requirement of 7.4.
@coreymckrill can we merge this PR? |
Looks like we still need a new approval from @prettyboymp since there were requested changes. |
@coreymckrill, @prettyboymp can you review again? I've already changed the changelog entry. |
384f67e
to
ea65150
Compare
@coreymckrill can we merge this PR? All suggestions made by @prettyboymp have been addressed. |
Requested changes have been made.
Changes proposed in this Pull Request:
Applied suggestions based on Rector's static analysis for PHP 8.1.
This is a continuation of #40801
Ref: D128479-code
How to test the changes in this Pull Request:
plugins/woocommerce/includes/admin/class-wc-admin-importers.php
functions.php
file or use the [Code Snippets extension](https://pe.wordpress.org/plugins/code-snippets/), in order to decrease the batch size.plugins/woocommerce/includes/admin/class-wc-admin-webhooks.php
plugins/woocommerce/includes/admin/helper/class-wc-helper.php
plugins/woocommerce/includes/admin/importers/class-wc-tax-rate-importer.php
plugins/woocommerce/includes/admin/importers/views/html-csv-import-done.php
plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-coupons.php
plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php
plugins/woocommerce/includes/admin/reports/class-wc-report-sales-by-category.php
plugins/woocommerce/includes/admin/settings/class-wc-settings-tax.php
save_tax_classes
is not used anymore. Tax are saved via ajax now.plugins/woocommerce/includes/admin/views/html-admin-page-status-report.php
plugins/woocommerce/includes/class-wc-ajax.php
plugins/woocommerce/includes/class-wc-deprecated-action-hooks.php
plugins/woocommerce/includes/class-wc-geo-ip.php
Changelog entry
Significance
Type
Message
Apply Rector suggestions for PHP 8.1
Comment