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

PHP 7.2: New OptionalRequiredFunctionParameters sniff #524

Merged
merged 1 commit into from
Nov 5, 2017

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 25, 2017

Previously a RequiredOptionalFunctionParameters sniff has been added which checks for missing function call parameters which were required and only became optional in a later PHP version.

This PR adds a sister-sniff which checks for missing function call parameters which originally were optional, but later became required.

Initially this sniff checks for the $results parameter for the parse_str() function for which the optional nature of the parameter became deprecated in PHP 7.2 (soft required).
It is expected that the parameter will become hard required in PHP 8.0.

Refs:

Includes unit tests.

Notes:
The commit contains a few minor changes to the RequiredOptionalFunctionParameters sniff to bring both sniffs in line with each other.

Previously a `RequiredOptionalFunctionParameters` sniff has been added which checks for missing function call parameters which were required and only became optional in a later PHP version.

This PR adds a sister-sniff which checks for missing function call parameters which originally were optional, but later became required.

Initially this sniff check for the `$results` parameter for the `parse_str()` function for which the optional nature of the parameter became deprecated in PHP 7.2 (soft required).
It is expected that the parameter will become hard required in PHP 8.0.

Includes unit tests.

Notes:
The commit contains a few minor changes to the `RequiredOptionalFunctionParameters` sniff to bring both sniffs in line with each other.
@jrfnl jrfnl requested a review from wimg October 25, 2017 11:18
@wimg wimg merged commit e0ca16e into master Nov 5, 2017
@wimg wimg deleted the feature/new-optionalrequiredfunctionparameter-sniff branch November 5, 2017 13:44
@jrfnl jrfnl added this to the 8.1.0 milestone Nov 13, 2017
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