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

NewPCREModifiers: add support for named parameters #1396

Merged
merged 1 commit into from
Oct 31, 2022

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 name used is in line with the name 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 reference:

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

Related to #1239

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 name used is in line with the name 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 reference:
* `preg_filter`: https://3v4l.org/eJNZe
* `preg_grep`: https://3v4l.org/Am8aX
* `preg_match_all`: https://3v4l.org/IoIJQ
* `preg_match`: https://3v4l.org/TfVDB
* `preg_replace_callback_array`: https://3v4l.org/Hp8rI
* `preg_replace_callback`: https://3v4l.org/BHj7T
* `preg_replace`: https://3v4l.org/0lr5d
* `preg_split`: https://3v4l.org/jJMg0

Includes adding/adjusting the unit tests to include tests using named parameters.
@jrfnl jrfnl requested a review from wimg October 26, 2022 13:45
@jrfnl jrfnl added this to the 10.0.0 milestone Oct 26, 2022
@jrfnl jrfnl added enhancement PR: quick merge PR only contains relatively simple changes PR: ready for review labels Oct 26, 2022
@wimg wimg merged commit 58d2225 into develop Oct 31, 2022
@wimg wimg deleted the feature/1239-newpcremodifiers-support-named-params branch October 31, 2022 15:25
@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.

None yet

2 participants