Search code examples
coding-stylephpstorm

PhpStorm short tags indentation (if/endif)


Here is the indentation that PhpStorm will generate for this code:

<?php if (count($foo) > 0) : ?>
<div>...</div>
<?php else : ?>
<p>...</p>
<?php endif; ?>

Is that supposed to be the wanted PHP indentation when mixing if/for/... blocks with HTML or is it a bug with the short tags?

I am talking about PhpStorm default formatting style. I am wondering if this behavior is intended by PhpStorm or a bug.


Solution

  • The final answer is that is a bug, if you expect (as anyone would I guess) the content of the if to be indented.

    I filed a bug: http://youtrack.jetbrains.com/issue/WI-11118.