PhpStorm 8.0.2 Help

Code Sniffer

File | Settings | Languages and Frameworks | PHP | Code Sniffer

The page is available only when the PHP plugin is enabled. The plugin is bundled with PhpStorm and activated by default. If not, enable it as described in Enabling and Disabling Plugins.

Use this page to register the PHP Code Sniffer tool in PhpStorm and configure Code Sniffer's behaviour.

Item Description
PHP Code Sniffer (phpcs) Path In this text box, specify the location of the Code Sniffer utility phpcs. Type the path manually or click the Browse button browseButton.png and select the path in the dialog box, that opens.

To check that the specified path to phpcs.bat ensures interaction between PhpStorm and Code Sniffer, that is, the tool can be launched from PhpStorm and PhpStorm will receive problem reports from it, click the Validate button. This validation is equal to running the phpcs --version command. If validation passes successfully, PhpStorm displays the information on the detected Code Sniffer version.

Maximum number of messages per file In this text box, set the upper limit for the total number of messages to be reported for a file. All the messages above this limit will be rejected. PhpStorm will display the following warning right in the code: Too many PHP Code Sniffer messages and suggest adding the file to the Ignored files list.
Tool process timeout In this text box, specify how long you want PhpStorm to wait for a result from PHP Code Sniffer, whereupon the process is killed to prevent excessive CPU and memory usage. This gives you the capability to fine tune the PHP Code Sniffer process behavior depending on the configuration of your computer and the rule sets used.
Ignored files This area displays a list of files that Code Sniffer skips. PhpStorm suggests adding a new file to the list during inspection when waiting for response from the Code Sniffer exceeds the limit specified in the Tool process timeout field. This is done to prevent slowing down processing. For each file, PhpStorm displays its name and location.
  • To delete a file from the list and have Code Sniffer process it again, select the file and click the Remove file button delete.png.
  • To remove all the files from the list, click the Clean the list button close.png.

See Also

Last modified: 29 January 2015