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

File::isReference(): bug fix - arrow function params passed by reference #3103

Closed

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Sep 5, 2020

The & for parameters passed by reference in an arrow function declaration were incorrectly not recognized as references.

This is the root cause of issue #3049, which affected the PSR12.Operators.OperatorSpacing and the Squiz.WhiteSpace.OperatorSpacing sniffs (and possibly/probably more sniffs).

Includes unit test.

Fixes #3049

The `&` for parameters passed by reference in an arrow function declaration were incorrectly not recognized as references.

This is the root cause of issue 3049, which affected the `PSR12.Operators.OperatorSpacing` and the `Squiz.WhiteSpace.OperatorSpacing` sniffs (and possibly/probably more sniffs).

Includes unit test.

Fixes 3049
@gsherwood
Copy link
Member

Thanks a lot for this fix. It did indeed fix both of the issues reported.

It has been merged in, but I was doing a rebase and the commit hashes got changed over.

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.

Incorrect error with arrow function and parameter passed as reference
2 participants