Skip to content

ChangedIntToBoolParamType: add support for named parameters#1370

Merged
jrfnl merged 1 commit intodevelopfrom
feature/1239-changedinttoboolparamtype-support-named-params
Oct 28, 2022
Merged

ChangedIntToBoolParamType: add support for named parameters#1370
jrfnl merged 1 commit intodevelopfrom
feature/1239-changedinttoboolparamtype-support-named-params

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 26, 2022

  1. Add support for function calls using named parameters by implementing the new PHPCSUtils 1.0.0-alpha4 PassedParameters::getParameterFromStack() method.
  2. Verified the parameter names used are in line with the names as per the PHP 8.0 release. PHP itself renamed a lot of parameters in PHP 8.0. As named parameters did not exist before PHP 8.0, the parameter name as per PHP 8.0 (or above) is the only relevant name.

Name verification references:

Includes adding/adjusting the unit tests to include tests using named parameters.

Note: this is changes the error code for the ob_implicit_flush violation, but as this is a new sniff which is being introduced in PHPCompatibility 10.0.0, this is not an issue.

Related to #1239

@jrfnl jrfnl added this to the 10.0.0 milestone Oct 26, 2022
@jrfnl jrfnl requested a review from wimg October 26, 2022 12:56
@jrfnl jrfnl added Type: enhancement PR: quick merge PR only contains relatively simple changes PR: ready for review labels Oct 26, 2022
1. Add support for function calls using named parameters by implementing the new PHPCSUtils 1.0.0-alpha4 `PassedParameters::getParameterFromStack()` method.
2. Verified the parameter names used are in line with the names as per the PHP 8.0 release.
    PHP itself renamed a lot of parameters in PHP 8.0. As named parameters did not exist before PHP 8.0, the parameter name as per PHP 8.0 (or above) is the only relevant name.

Name verification references:
* `ob_implicit_flush`: https://3v4l.org/SVXD2
* `sem_get`: https://github.com/php/php-src/blob/5aaffc8095eeb69407855b33d1939dd5ebd619ca/ext/sysvsem/sysvsem.stub.php#L9

Includes adding/adjusting the unit tests to include tests using named parameters.

Note: this is changes the error code for the `ob_implicit_flush` violation, but as this is a new sniff which is being introduced in PHPCompatibility 10.0.0, this is not an issue.
@jrfnl jrfnl force-pushed the feature/1239-changedinttoboolparamtype-support-named-params branch from 3700875 to 268e153 Compare October 28, 2022 05:31
@jrfnl
Copy link
Member Author

jrfnl commented Oct 28, 2022

Rebased without changes to get it passed the merged conflicts. Will merge once the build passes.

@jrfnl jrfnl enabled auto-merge October 28, 2022 05:31
@jrfnl jrfnl merged commit e9afabe into develop Oct 28, 2022
@jrfnl jrfnl deleted the feature/1239-changedinttoboolparamtype-support-named-params branch October 28, 2022 05:53
@jrfnl jrfnl removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Dec 7, 2022
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.

2 participants