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

PHP 7.4 compatibility / defensive coding #1772

Merged
merged 1 commit into from Jul 25, 2019

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 21, 2019

WPCS is running into two PHP 7.4 issues where we use array access on a non-array value.
This PR fixes both.

Refs:

Build showing the issues:

WPCS is running into two PHP 7.4 issues where we use array access on a non-array value.
This PR fixes both.

Refs:
* https://wiki.php.net/rfc/deprecate_curly_braces_array_access

Build showing the issues:
* https://travis-ci.com/WordPress/WordPress-Coding-Standards/jobs/218025587
@jrfnl
Copy link
Member Author

jrfnl commented Jul 21, 2019

FYI: just in case anyone is now wondering "but hang on, the PHP 7.4 builds still aren't passing". That's correct and caused by PHP deprecation notices related to PHPCS code upstream.

There is already a PR open upstream to fix these: squizlabs/PHP_CodeSniffer#2560

And for the stable PHPCS versions, I have a PR ready & waiting which will clean up the Travis output and make it more usable for these situations.
Travis test output for that PR combined with this one: https://travis-ci.com/WordPress/WordPress-Coding-Standards/builds/119936162
As you can see, with that combination, the PHP 7.4 build against stable PHPCS is passing.

@jrfnl
Copy link
Member Author

jrfnl commented Jul 24, 2019

The upstream fixes have been merged, so I restarted the build and the PHP 7.4 / PHPCS master build is now passing: https://travis-ci.com/WordPress/WordPress-Coding-Standards/jobs/218028556

@dingo-d dingo-d merged commit 6aab357 into develop Jul 25, 2019
@jrfnl jrfnl deleted the feature/php-7.4-compatibility branch July 25, 2019 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants