Skip to content

PHP 8.1 | PassedParameters::hasParameters(): prevent false positives for first class callable declarations#362

Merged
jrfnl merged 1 commit into
developfrom
php-8.1/passedparams-prevent-false-pos-first-class-callables
Oct 15, 2022
Merged

PHP 8.1 | PassedParameters::hasParameters(): prevent false positives for first class callable declarations#362
jrfnl merged 1 commit into
developfrom
php-8.1/passedparams-prevent-false-pos-first-class-callables

Conversation

@jrfnl

@jrfnl jrfnl commented Oct 15, 2022

Copy link
Copy Markdown
Member

PHP 8.1 introduced a new callback declaration syntax, called "first class callables". This syntax can be easily confused with a function call.

While it remains the responsibility of individual sniffs to verify if something is a function call before passing it to any of the PassedParameters methods, a little defensive coding to prevent incorrect results goes a long way.

Includes tests.

Refs:

…for first class callable declarations

PHP 8.1 introduced a new callback declaration syntax, called "first class callables".
This syntax can be easily confused with a function call.

While it remains the responsibility of individual sniffs to verify if something is a function call before passing it to any of the `PassedParameters` methods, a little defensive coding to prevent incorrect results goes a long way.

Includes tests.

Refs:
* https://wiki.php.net/rfc/first_class_callable_syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant