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

Swap join() with implode() #627

Merged
merged 3 commits into from
May 11, 2021
Merged

Swap join() with implode() #627

merged 3 commits into from
May 11, 2021

Conversation

mjangda
Copy link
Member

@mjangda mjangda commented Jan 20, 2021

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

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.
@nielslange nielslange linked an issue Mar 10, 2021 that may be closed by this pull request
Copy link
Member

@htdat htdat left a 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

@htdat htdat requested a review from mikeyarce April 12, 2021 04:02
@htdat htdat self-assigned this Apr 12, 2021
@htdat htdat requested a review from natebot May 10, 2021 08:27
@htdat
Copy link
Member

htdat commented May 10, 2021

@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?

Copy link
Contributor

@natebot natebot left a comment

Choose a reason for hiding this comment

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

Looks good

@htdat htdat merged commit 6d63021 into master May 11, 2021
@htdat htdat deleted the update/php74-compat branch May 11, 2021 00:43
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.

PHP 7.4 Compat?
4 participants