ChangedIntToBoolParamType: add support for named parameters by jrfnl · Pull Request #1370 · PHPCompatibility/PHPCompatibility

@jrfnl jrfnl mentioned this pull request

Oct 26, 2022

41 tasks

wimg

wimg approved these changes Oct 27, 2022

@jrfnl

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 deleted the feature/1239-changedinttoboolparamtype-support-named-params branch

October 28, 2022 05:53