Skip to content

PHP 7.2: New OptionalRequiredFunctionParameters sniff#524

Merged
wimg merged 1 commit intomasterfrom
feature/new-optionalrequiredfunctionparameter-sniff
Nov 5, 2017
Merged

PHP 7.2: New OptionalRequiredFunctionParameters sniff#524
wimg merged 1 commit intomasterfrom
feature/new-optionalrequiredfunctionparameter-sniff

Conversation

@jrfnl
Copy link
Copy Markdown
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