-
Notifications
You must be signed in to change notification settings - Fork 132
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
Swap join() with implode() #627
Conversation
And correct the order of the params. PHP 7.4 changes the order of the params for the join() function and implode() is the preferred way to join an array of strings anyway.
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.
I manually tested before and after this PR with PHP 7.4 and the result looks good.
Before this PR
phpcs -p . --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4 --ignore=vendor,node_modules
......................W.W.... 29 / 29 (100%)
FILE: .../edit-flow/modules/calendar/calendar.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1226 | WARNING | Passing the $glue and $pieces parameters in reverse order to join has been deprecated since PHP 7.4; $glue should be the first parameter and $pieces the second
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: .../edit-flow/modules/story-budget/story-budget.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
414 | WARNING | Passing the $glue and $pieces parameters in reverse order to join has been deprecated since PHP 7.4; $glue should be the first parameter and $pieces the second
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 7.79 secs; Memory: 28MB
After applying this PR
➜ edit-flow git:(master) ✗ gh pr checkout 627
M package-lock.json
Switched to a new branch 'update/php74-compat'
➜ edit-flow git:(update/php74-compat) ✗ phpcs -p . --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4 --ignore=vendor,node_modules
............................. 29 / 29 (100%)
Time: 7.74 secs; Memory: 28MB
@natebot and @mikeyarce - I think it's good to merge this change given that PHP 5.6 to PHP 7.4 tests are all green as shown above? |
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
And correct the order of the params. PHP 7.4 changes the order of the params for the join() function and implode() is the preferred way to join an array of strings anyway.
Steps to Test
TODO