I found reformatting php source code in phpstorm for particular file is Ctrl+Shift+Alt+L. But is there any way to do for whole project files?
-
2Have you tried invoking that action on folder (hint: in Project View panel) ?? Try it ...LazyOne– LazyOne2015-11-13 17:01:11 +00:00Commented Nov 13, 2015 at 17:01
-
Yes. I tired. Not happening. :(Bala– Bala2015-11-13 17:20:46 +00:00Commented Nov 13, 2015 at 17:20
-
Worked for me (test project though)... No ideas then.LazyOne– LazyOne2015-11-13 17:51:10 +00:00Commented Nov 13, 2015 at 17:51
-
I am using 9.0.2 version.Bala– Bala2015-11-14 04:21:58 +00:00Commented Nov 14, 2015 at 4:21
-
1There was an option before to reformat folders on right click but there isn't one now in any of JetBrains products. I also have the same problem i need to reformat large codebase.Mladen Petrovic– Mladen Petrovic2016-11-24 12:56:47 +00:00Commented Nov 24, 2016 at 12:56
2 Answers
If you have issues opening the "reformat code" popup for multiple files, make sure that you don't have any open files as it'll otherwise only reformat the current open file (edit: sometimes - I still haven't been able to figure out why it allows you to reformat the entire code sometimes, but regardless, this fix will work if it doesn't allow you to).
You can simply right click any file on your file list and select "Close all".
After you've done this, select the folder you want to reformat in the code view:
Finally, with all files open you can now select "Reformat code" in the "Code" part of your main toolbar:
You'll now get the regular popup that most guides seem to mention, but that's otherwise hidden for some reason:



