Conversation
Refs: * https://github.com/Yoast/yoastcs/releases/tag/3.3.0 * https://github.com/PHPCSStandards/PHP_CodeSniffer/releases * https://github.com/PHPCSStandards/composer-installer/releases * https://github.com/PHPCSStandards/PHPCSUtils/releases * https://github.com/PHPCSStandards/PHPCSExtra/releases * https://github.com/PHPCompatibility/PHPCompatibilityWP/releases * https://github.com/WordPress/WordPress-Coding-Standards/releases * https://github.com/slevomat/coding-standard/releases * https://github.com/sirbrillig/phpcs-variable-analysis/releases
Since PHP 7.3, PHP allows for trailing commas in function calls. Similar to trailing commas in multi-line arrays, having a comma after the last parameter in a multi-line function call will make the diff smaller if a new parameter is added at a later point in time, allowing reviewers to focus on what's actually changed. For a single-line function call, no such advantage can be gained. As this codebase has dropped support for PHP < 7.4 by now, we can apply this modernization in all multi-line function calls. Ref: * https://wiki.php.net/rfc/trailing-comma-function-calls
... as allowed and available since PHP 7.4.
Since PHP 7.4, PHP allows using numeric literal separators in integers and floats to improve the readability of long numbers. As this codebase has dropped support for PHP < 7.4 by now, we can apply this modernization to all long numbers in this codebase. Ref: * https://wiki.php.net/rfc/numeric_literal_separator
Pull Request Test Coverage Report for Build 21727572250Details
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Composer: update to YoastCS 3.3.0
Refs:
Modernize: use trailing comma in multi-line function call
Since PHP 7.3, PHP allows for trailing commas in function calls.
Similar to trailing commas in multi-line arrays, having a comma after the last parameter in a multi-line function call will make the diff smaller if a new parameter is added at a later point in time, allowing reviewers to focus on what's actually changed.
For a single-line function call, no such advantage can be gained.
As this codebase has dropped support for PHP < 7.4 by now, we can apply this modernization in all multi-line function calls.
Ref:
Modernize: use null coalesce equals operator
... as allowed and available since PHP 7.4.
Modernize: use numeric literal separators
Since PHP 7.4, PHP allows using numeric literal separators in integers and floats to improve the readability of long numbers.
As this codebase has dropped support for PHP < 7.4 by now, we can apply this modernization to all long numbers in this codebase.
Ref:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps: