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

Core: remove an exclusion #2415

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 11, 2023

Turns out the exclusion is a little too aggresive. The Generic.WhiteSpace.LanguageConstructSpacing will throw an error when there is too much whitespace, but not when there is no whitespace and the next thing is an open parenthesis.

By removing the exclusion, an error will now (correctly) be thrown when there is no whitespace between a closure use keyword and the open parenthesis.

It also means that where there is too much whitespace between the keyword and the open parenthesis, two errors will be thrown, one from the Generic.WhiteSpace.LanguageConstructSpacing sniff and one from the Squiz.Functions.MultiLineFunctionDeclaration sniff.

Well, so be it. As both sniffs expect the same thing, this shouldn't lead to fixer conflicts anyhow.

See #764 (comment)

Turns out the exclusion is a little too aggresive.
The `Generic.WhiteSpace.LanguageConstructSpacing` _will_ throw an error when there is too much whitespace, but not when there is no whitespace and the next thing is an open parenthesis.

By removing the exclusion, an error will now (correctly) be thrown when there is no whitespace between a closure `use` keyword and the open parenthesis.

It also means that where there is _too much_ whitespace between the keyword and the open parenthesis, two errors will be thrown, one from the `Generic.WhiteSpace.LanguageConstructSpacing` sniff and one from the `Squiz.Functions.MultiLineFunctionDeclaration` sniff.

Well, so be it. As both sniffs expect the same thing, this shouldn't lead to fixer conflicts anyhow.

See #764 (comment)
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@dingo-d dingo-d merged commit 49bc4b7 into develop Dec 12, 2023
42 checks passed
@dingo-d dingo-d deleted the feature/core-closure-use-keyword-spacing branch December 12, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment