As a .NET developer, I'm familiar with the behavior of Visual Studio which automatically formats the code in the right way, e.g. after writing a semicolon or closing an if-statement. Lets say for example I enter the following not well formatted C# code in Visual Studio
int i=4
After I write the closing ;
the IDE will following the code standards and insert spaces around the equal sign:
int i = 4;
But now I have to write a PHP application using PhpStorm. It's annoying that PhpStorm seems not so smart like Visual Studio. When I write there the same code like $i=4
then the formatting is kept ugly, although I enter the semicolon: $i=4;
I found out that I can re-format the whole script using a keyboard combination. But this is not really smart, I always have to repeatedly press the combination.
Is there any way to let PhpStorm act as smart as Visual Studio, so that my code is automatically formatted on semicolons, closing brackets and so on?