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
I get error starting from the line "case 'testing': .....'
Error: Line indented incorrectly; expected 12 spaces, found 8
This require me to justify the "case 'testing':" with its body and "default:" case with its body to closing curly brace of match expression!
Like this:
gsherwood
changed the title
Using match-expression inside switch-case cases error: Line indented incorrectly;
Line indented incorrectly false positive when using match-expression inside switch case
Jan 10, 2022
This problem was caused by the match expression being returned instead of assigned to a variable and then returned. The return here is special as it is the closer for the case statement, so everything got confused. There was already code to handle this for anon classes and closures, so I treat match in the same way.
Thanks for reporting this. The fix will be in 3.7.0.
Describe the bug
When I uses
match-expression
inside aswitch-case
, I get non logical errorCode sample
I get error starting from the line "case 'testing': .....'
This require me to justify the "case 'testing':" with its body and "default:" case with its body to closing curly brace of match expression!
Like this:
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
A clear and concise description of what you expected to happen.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: