PHP CS Fixer
On this page, enable and configure the PHP CS Fixer 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 |
Show ignored files | Click to open the PHP CS Fixer Ignored Files dialog, which lists the files that PHP CS Fixer skips. PhpStorm suggests adding a new file to the list during inspection when waiting for response from the PHP CS Fixer 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.
|
Allow risky rules for built-in rulesets | Select the checkbox to allow risky rules, that is, the rules that can change code behavior. By default, risky rules are not allowed. |
Ruleset | Appoint the ruleset to apply.
|
Run mode | Configure how often PHP CS Fixer is triggered to analyze code:
|
Idle threshold (ms) | Define the delay time in milliseconds after code modification before PHP CS Fixer runs. |
Minimum interval (ms) | Define the minimum time in milliseconds that must pass between two consecutive runs of PHP CS Fixer on the same file. This prevents PHP CS Fixer from running too frequently in case of frequent file savings or heavy typing. |
PHP CS Fixer Dialog
The dialog opens when you click next to the Configuration list on the PHP CS Fixer page.
Use this dialog to configure the used PHP interpreter, path to the PHP CS Fixer executable file, as well as PHP CS Fixer's behaviour. For more information, refer to PHP CS Fixer.
Item | Description |
|---|---|
Interpreters pane | The left-hand pane of the dialog shows the default PHP interpreter to use the PHP CS Fixer from. To add a different interpreter, click |
PHP CS Fixer path | In this field, specify the location of the PHP CS Fixer script: php-cs-fixer.bat for Windows or php-cs-fixer for Linux and macOS. PhpStorm detects the path to the PHP CS Fixer executable file in the To check that the specified path to php-cs-fixer.bat or php-cs-fixer ensures interaction between PhpStorm and PHP CS Fixer, 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 |
Tool process timeout | In this field, specify how long you want PhpStorm to wait for a result from PHP CS Fixer. If the timeout is exceeded, the process is terminated to prevent excessive CPU and memory usage. This lets you fine-tune the PHP CS Fixer process behavior depending on the configuration of your computer and the rule sets used. |