Skip to content

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

Closed
@VincentLanglet

Description

@VincentLanglet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions