PHP code sniffer scripts can be found here. As explained on that page, there are two scripts – one that detects issues or violations of a defined coding standard and other that fixes those violations.
You can configure your code editor to use these scripts. In this post I’ll explain how to do this for Sublime Text.
The first step is to of course download those scripts.
Next install PHP Code Sniffer package in Sublime Text by Package Control. If you don’t have this, it can be installed by pressing CMD+SHIFT+P > searching Install Package Control.
Once installed, you can press CMD+SHIFT+P once again and search for Package Control: Install Package. Hit enter, search for phpcs and install it.

Finally add your settings to PHP Code Sniffer by going to Sublime Text > Preferences > Package Settings > PHP Code Sniffer > Settings - User.
What settings to add here? You can check the options available to you by opening Settings - Default.
Since you want Sublime to be able to use the scripts you downloaded before, just go ahead and add their paths as follows –

I’m not quite sure what the -n stands for but note that I’ve added the --standard as WordPress by following the WordPress Coding Standard.
Now each time I save my file, it’ll autodetect issues with it (keeping WP standard in mind).

