Format Code [better] — Phpstorm
Go to Settings → Editor → Code Style → PHP
PhpStorm has a powerful formatting engine built right in. If you aren't using these shortcuts, you are working too hard. phpstorm format code
If the default formatting drives you crazy (e.g., you prefer Allman braces or specific array alignment), you don't have to suffer. Go to Settings → Editor → Code Style
Here you can tweak everything:
Formatting is about layout, but what about messy code? Try this: phpstorm format code