Sage 9 psr2 code style phpstorm

Hey y’all,

Just bit curious how does one go about keeping their code tidy with sage 9.0.0-beta.2 using psr-2 code styles?

My IDE of choice is phpstorm normally I have no problem having my code styles defined in my settings when running the shortcut (on mac) cmd + opt + shift + l which would make the code “pretty” and clean.

Was getting ready to start programming my first project with sage 9.0.0-beta.2 with the blade files, when running the format rules, it removes the 2 spacing rule and flattens the code.

Any recommendations?

Expected formatting:

Blade formatting:

I don’t know if that’s an issue with Sage and PSR-2, I think it might be a “feature” of Intellij products. I use Intellij IDEA, with all the PHP and JavaScript plugins installed, including Blade. Going to Settings > Editor > Code Style > Blade and adding the html and body tags do the same thing that your gif shows.

I wonder if it does the same thing with a plain PHP or HTML file?

Pretty sure it does. I had this happen to me the other day with a “regular” html in PHPStorm.

So if Intellij suggests it, it must be a best practice. DO IT

1 Like

@kalenjohnson, Thanks your right it was a preference setting under html which was changing the output of the desired effect. Under Editor > Code Styles > HTML
“Other” tab preference  Do not indent child of:  dropped  html & body provides the desired effect.


HTML Perference