Disable autoformat in IntelliJ / PHPStorm

When using IntelliJ or PHPStorm as IDE, I use the autoformat for code (Code -> Reformat Code or Ctrl+Alt+L). It works great. But in some cases I need to disable autoformat for some parts of the code.

This is how you can disable autoformat in your code:

The result after executing the autoformat command (Code -> Reformat Code or Ctrl+Alt+L) would be (with my setings):

Further information about disable autoformat:

Can be found under https://stackoverflow.com/questions/3375307/how-to-disable-code-formatting-for-some-part-of-the-code-using-comments. Here you also find, how to set it up.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.