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

PSR12.Squiz.OperatorSpacing false positive for default values of arrow functions #3102

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Sep 5, 2020

The plus/minus in a default value of a function parameter declaration is ignored for normal functions and closures, but wasn't ignored yet for arrow functions.

Fixed now.

Includes unit test + test for the same for closures, which so far wasn't tested yet.

This also, by extension, fixes the same issue in the PSR12.Operators.OperatorSpacing sniff.

@jrfnl jrfnl force-pushed the feature/squiz-operatorspacing-arrow-function-defaults-plus-minus branch from 285fff5 to 49de503 Compare September 13, 2020 23:13
@jrfnl
Copy link
Contributor Author

jrfnl commented Sep 13, 2020

Rebased for merge conflicts

The plus/minus in a default value of a function parameter declaration is ignored for normal functions and closures, but wasn't ignored yet for arrow functions.

Fixed now.

Includes unit test + test for the same for closures, which so far wasn't tested yet.

This also, by extension, fixes the same issue in the `PSR12.Operators.OperatorSpacing` sniff.
@gsherwood gsherwood added this to Idea Bank in PHPCS v3 Development via automation Sep 29, 2020
@gsherwood gsherwood added this to the 3.5.7 milestone Sep 29, 2020
@gsherwood gsherwood changed the title PSR12/Squiz/OperatorSpacing: bug fix with arrow functions PSR12.Squiz.OperatorSpacing false positive for default values of arrow functions Sep 29, 2020
gsherwood added a commit that referenced this pull request Sep 29, 2020
@gsherwood
Copy link
Member

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

@gsherwood gsherwood closed this Sep 29, 2020
PHPCS v3 Development automation moved this from Idea Bank to Ready for Release Sep 29, 2020
@jrfnl jrfnl deleted the feature/squiz-operatorspacing-arrow-function-defaults-plus-minus branch September 29, 2020 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PHPCS v3 Development
Ready for Release
Development

Successfully merging this pull request may close these issues.

None yet

2 participants