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

ETK: make PHP linting PHP 8 compatible #71062

Merged
merged 2 commits into from
Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<ruleset name="editing-toolkit">
<description>Editing Toolkit Plugin Rules</description>

<!--
Suppress all PHP run-time notices across all PHP versions, thus preventing
errors caused by WordPress Coding Standards not supporting PHP 8.0+ yet.
Once WPCS supports PHP8, this can be removed.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />
Copy link
Member

Choose a reason for hiding this comment

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

Noting this will disable all deprecated syntax and not just the syntax that was deprecated in PHP 8. Is that intentional? If yes, then we might want to be explicit about it in the comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Open to ideas how to limit this just to specific errors or even just when running in PHP, but keep runtime errors for other versions, or even just for CI runs.

I'll update the comment tho!

Copy link
Member

Choose a reason for hiding this comment

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

I don't think there's a better way to do it TBH. I'm fine with this temporary approach, as long as we're explicit about it in the comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

check the new one out, 3980d3a

Copy link
Member

Choose a reason for hiding this comment

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

Looks good, thank you 🙌


<rule ref="Jetpack"/>
<rule ref="WordPress.Utils.I18nTextDomainFixer">
<properties>
Expand Down