Skip to content

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

Closed
jrfnl wants to merge 1 commit intosquizlabs:masterfrom
jrfnl:feature/squiz-operatorspacing-arrow-function-defaults-plus-minus
Closed

PSR12.Squiz.OperatorSpacing false positive for default values of arrow functions#3102
jrfnl wants to merge 1 commit intosquizlabs:masterfrom
jrfnl:feature/squiz-operatorspacing-arrow-function-defaults-plus-minus

Conversation

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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants