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:
1 2 3 4 5 6 7 8 9 |
// @formatter:off echo 'HERE COMES A LOT' . ' OF UNFORMATED CODE NOW! :-)'; $aArray=array('Not', $formated, "too!"); // @formatter:on echo 'This will' . ' be formatted again! :-)'; $aArray=array('This will be', $formated, "too!"); |
The result after executing the autoformat command […]