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

Generic.WhiteSpace.ArbitraryParenthesesSpacing doesn't detect issues for statements directly after a control structure #2826

Closed
VincentLanglet opened this issue Jan 16, 2020 · 0 comments · Fixed by #2876

Comments

@VincentLanglet
Copy link
Contributor

The following code

if (true) {}
( 1 + 2 ) === 3 ? $a = 1 : $a = 2;

return no error.

This because ignoreTokens contains T_CLOSE_CURLY_BRACKET.
It seems to be to avoid having duplicate error message with

$obj->{$var}( $foo,$bar );

But T_CLOSE_CURLY_BRACKET should not be ignored when it's the end of a function, a control structure or a class.

@gsherwood gsherwood added this to Idea Bank in PHPCS v3 Development via automation Feb 23, 2020
@gsherwood gsherwood added this to the 3.5.5 milestone Feb 23, 2020
@gsherwood gsherwood changed the title [Generic.WhiteSpace.ArbitraryParenthesesSpacing] False negative Generic.WhiteSpace.ArbitraryParenthesesSpacing doesn't detect issues for statements directly after a control structure Feb 24, 2020
gsherwood added a commit that referenced this issue Feb 24, 2020
PHPCS v3 Development automation moved this from Idea Bank to Ready for Release Feb 24, 2020
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 a pull request may close this issue.

2 participants