PHPStorm is a very nice IDE, but it does one thing that annoys me.
I (and my team) write our switch statements like so:
switch ($foo) {
case 'a' :
// some code
break;
}
PHPStorm auto-corrects this to be
switch ($foo) {
case 'a' :
// some code
break;
}
Note that the break
is indented along with the code. I don't want this to happen.
I've looked in the code style section, but the only option for switches is to indent the case branches.
Does anyone know how stop PHPStorm from doing this?
You can change this default behavior in
settings | Editor | Code Style | PHP | Wrapping and Braces
uncheck indent 'break' from 'case' option
Based on the recommendations in PSR-2 on code style, PHPStorm displays it the recommended way.
If you really want to change it, you can do it in Editor > Code style > PHP > Wrapping and Braces
under the 'switch' statement
and uncheck the Indent 'break' from 'case
.
Disclaimer, the screenshot is from IntelliJ, but you should be able to find the same setting in the same location
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With