When I use the comment shortcut (Ctrl + /) the slashes are placed at the beginning of the line, like this:
protected function before()
{
// echo "(before) ";
}
However I'd expect this behaviour:
protected function before()
{
//echo "(before) ";
}
How do I configure PhpStorm to use the latter approach?
Settings/Preferences
Editor | Code Style | PHP
Other
tab and uncheck Line comments at first column
optionIn modern versions it is now located at the Code Generation
tab:
PhpStorm 2018.3 and newer:
File -> Settings (Ctrl + Alt + S)
Editor -> Code Style -> PHP
(tab) Code Generation -> Comment Code -> (uncheck) Line comment at first column
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With