You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gsherwood
changed the title
ScopeIndent incorrect when using ternary operator
Generic.WhiteSpace.ScopeIndent false positive when using ternary operator with short arrays
Nov 18, 2019
…using ternary operator with short arrays
The first token was being recalculated but the indent was not being modified along with that new first token.
Thanks for reporting this. There was a problem specifically checking short arrays in this case. The sniff was trying to align the closing bracket with the line that the opening bracket is on (hence the 8 spaces required) instead of with the start of the statement ($a = ...), which only required 4 spaces.
Generic.WhiteSpace.ScopeIndent
expects 4 more whitespace characters when using a ternary operator:Alternatives using
?:
or??
work fine with only 4 whitespace characters:Is this expected behaviour?
The text was updated successfully, but these errors were encountered: