Fail code formatting?

I have been using phpstorm for quite a while now however I keep having issues with it messing up the formatting when it comes to php inside html.

Attached it an example of what it is doing when I tell it to format the code.

I have also attached my config file.

Am I doing something wrong?
Is there something wrong with my config settings?
Or is there a bug in the editor?

Matt



Attachment(s):
settings.jar
retarded indentation.PNG
4 comments
Comment actions Permalink

There may be several different issues: if you mean the indentation of statement after <?php, it's a know bug which hasn't been fixed yet.  For other formatting issues it makes sense to submit a bug (or bugs) to http://youtrack.jetbrains.net.

0
Comment actions Permalink

Is there an expected fix for this by chance?

0
Comment actions Permalink

Yes, absolutely. A problem of indentation after <?php tag has already been fixed for 3.0 (the first EAP is expected quite soon).

0
Comment actions Permalink

and what about PHP enclosing tags, can't be aligned on new line when mixed with HTML code ?


before reformat:

<h1>The Blog By</h1><?php foreach ($posts as $post) : ?>
    <article>
    </article><?php endforeach; ?>



after reformat:

<h1>The Blog By</h1><?php foreach ($posts as $post) : ?>
    <article>
    </article><?php endforeach; ?>



expected result:

<h1>The Blog By</h1>
<?php foreach ($posts as $post) : ?>
    <article>
   
    </article>
<?php endforeach; ?>

0

Please sign in to leave a comment.