Code style in PHP tags following HTML style in .html file...

I'm not understanding this... PHP code style inside of `<?php ?>` tags should follow what I have set in Code Style > PHP, not Code Style > HTML just because the file is named 'whatever.html' instead of 'whatever.php'.

There's mostly different rules for the PHP and HTML languages because ... they're different languages!

Right now because someone before me named all of the PHP files `.html`, PHPStorm is defaulting to the Code Style > HTML even inside of functions, arrays, classes, etc... those settings are not even in Code Style > HTML, and it's completely ignoring what I'm setting in Code Style > PHP for indentation.

Why?! How can the HTML styler possibly understand how PHP functions should be indented? Or whether to use tabs or spaces? This makes no sense. Everything in php tags should use the PHP code style, period, until an "echo" or something similar is writing actual HTML.

1 comment

You might be facing one of the issues caused by mixed php/html formatting, e.g.:

If you'd like to investigate this deeper - please attach a file/project we could actually look into.


Please sign in to leave a comment.