4

I have PhpStorm 10 and want to setup php Code Sniffer to automatically correct me code. This article https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm points to "Project Settings | Code Style" and I cannot even find that. I have File | Edit | View | Navigate | Code | Refactor | Run | Tools | VCS | Window | Help at the top and have no idea where to find project settings. I do have File > Settings but cannot figure it out.

My project is a web portal built in Symfony. I saw a colleague run Atom and when he saves a file it is code-fixed on the fly - that is what I want. Help please.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Jack Smit
  • 3,093
  • 4
  • 30
  • 45
  • *"... points to "Project Settings | Code Style" and I cannot even find that."* Look at `Settings/Preferences | Editor | Code Style`. Hint: Settings screen has search field -- try it. – LazyOne Apr 05 '16 at 13:23

2 Answers2

1

PhpStorm does not support code fixing on the fly with Code Sniffer.

https://youtrack.jetbrains.com/issue/WI-25815 -- watch this ticket (star/vote/comment) to get notified on any progress.


Right now, if you wish you may create an External Tools entry for that and run it manually when needed.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
0

Find this from web (how to config the external tools)

https://thiagoponte.wordpress.com/2015/08/03/run-php-codesniffer-code-beautifier-and-fixer-from-phpstorm/

enter image description here

aristotll
  • 8,694
  • 6
  • 33
  • 53