PhpStorm 2026.2 Help

PHP_CodeSniffer

On this page, enable and configure the PHP_CodeSniffer quality tool.

Item

Description

Configuration

Select the required interpreter from the list. The list contains all the currently configured local and remote PHP interpreters. For more information, refer to Configure local PHP interpreters and Configure remote PHP interpreters.

Clicking the Browse button to the right of the drop-down list opens PHP_CodeSniffer Dialog.

Show ignored files

Click to open the PHP_CodeSniffer Ignored Files dialog, which lists the files that PHP_CodeSniffer skips. PhpStorm suggests adding a new file to the list during inspection when waiting for response from the PHP_CodeSniffer 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 add a file, click the Add button and locate the desired file in the dialog that opens.

  • To delete a file from the list and have PHP_CodeSniffer process it again, select the file and click the Remove file button the Remove button.

  • To remove all the files from the list, click the Close button.

Check files with extensions

Provide a comma-separated list of file extensions that should be checked by PHP_CodeSniffer.

Show warnings as...

To have PHP_CodeSniffer report warnings in addition to errors, select the checkbox and choose the severity degree from the list. Clear the checkbox to have only errors reported and suppress reporting warnings.

Show sniff name

Select the checkbox to have the corresponding sniff's name displayed in the editor or the inspection results in addition to the inspection summary.

Installed standard paths

If you are relying on a custom third-party coding standard (for example, Coder or Joomla Coding Standards), you need to integrate it with PHP_CodeSniffer prior to using it. To do this, select the Installed standard paths checkbox, click the Browse button and select the custom standard installation directory in the dialog that opens.

Coding standard

Appoint the coding standard to apply.

  • To use one of the predefined coding standards, select it in the Coding standard list, appoint the coding style to check your code against. The list contains all the coding standards installed inside the main php_codesniffer directory structure.

  • To have your code checked against your own previously defined coding standard, choose Custom from the list and provide the path to the ruleset.xml file with your own coding standard. Type the path manually or click the Browse button and select the relevant folder in the dialog that opens.

Run mode

Configure how often PHP_CodeSniffer is triggered to analyze code:

  • On the fly – PHP_CodeSniffer runs automatically in the background. Issues are highlighted in the editor as you type.

  • On idle – PHP_CodeSniffer runs after you stop typing and the inactivity period specified in the Idle threshold (ms) field passes.

  • On save – PHP_CodeSniffer is triggered only when the file is saved either manually or via PhpStorm's autosave. Issue highlighting is updated only when the file state is persisted to disk.

Idle threshold (ms)

Define the delay time in milliseconds after code modification before PHP_CodeSniffer runs.

Minimum interval (ms)

Define the minimum time in milliseconds that must pass between two consecutive runs of PHP_CodeSniffer on the same file. This prevents PHP_CodeSniffer from running too frequently in case of frequent file savings or heavy typing.

PHP_CodeSniffer Dialog

The dialog opens when you click the Browse button next to the Configuration list on the PHP_CodeSniffer page.

Use this dialog to configure the used PHP interpreter, path to the PHP_CodeSniffer executable file, as well as PHP_CodeSniffer's behaviour. For more information, refer to PHP_CodeSniffer.

Item

Description

Interpreters pane

The left-hand pane of the dialog shows the default PHP interpreter to use the PHP_CodeSniffer from. To add a different interpreter, click the Add button and select an item from the list of CLI interpreters configured in the project.

PHP_CodeSniffer path

In this field, specify the location of the PHP_CodeSniffer script: phpcs.bat for Windows or phpcs for Linux and macOS.

PhpStorm detects the path to the PHP_CodeSniffer executable file in the vendor/bin folder and fills in the field automatically, but you can edit it if necessary. Type the path manually or click the Browse button and select the path in the dialog that opens.

To check that the specified path to phpcs.bat or phpcs ensures interaction between PhpStorm and PHP_CodeSniffer, 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 PHP_CodeSniffer version.

Tool process timeout

In this field, specify how long you want PhpStorm to wait for a result from PHP_CodeSniffer. If the timeout is exceeded, the process is terminated to prevent excessive CPU and memory usage. This lets you fine-tune the PHP_CodeSniffer process behavior depending on the configuration of your computer and the rule sets used.

PHP Code Beautifier and Fixer Settings

In this area, provide a custom path to the PHP Code Beautifier and Fixer tool in the Path to phpcbf field. Type the path manually or click the Browse button and select the path in the dialog that opens.

PHP Code Beautifier and Fixer lets you automatically fix many of the errors detected by PHP_CodeSniffer.

29 May 2026