PHPStan
On this page, enable and configure the PHPStan 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 PHPStan Ignored Files dialog, which lists the files that PHPStan skips. PhpStorm suggests adding a new file to the list during inspection when waiting for response from the PHPStan 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.
|
Full project run (batch mode only) | Use the option to select whether the entire project or only its source roots are included in the inspection run scope. |
Editor mode (requires PHPStan 1.12.27+ / 2.1.17+) | With the checkbox selected, PhpStorm runs PHPStan checks with the For more information about editor mode in PHPStan, see PHPStan documentation. |
Level | Provide the desired Rule Level against which the PHPStan checks are performed. Note that if a configuration file is provided, PhpStorm relies on the level value specified in this file, and the Level field is ignored. |
Configuration file | Provide the path to the PHPStan configuration file. |
Autoload file | Provide the path to the autoloader. Note that if a configuration file is provided, PhpStorm relies on the autoload-file value specified in this file, and the Autoload file field is ignored. |
Memory limit | Provide the maximum amount of RAM PHPStan is allowed to allocate. You can either provide an explicit integer value in bytes or use a shorthand notation ( |
Run mode | Configure how often PHPStan is triggered to analyze code:
|
Idle threshold (ms) | Define the delay time in milliseconds after code modification before PHPStan runs. |
Minimum interval (ms) | Define the minimum time in milliseconds that must pass between two consecutive runs of PHPStan on the same file. This prevents PHPStan from running too frequently in case of frequent file savings or heavy typing. |
PHPStan Dialog
The dialog opens when you click next to the Configuration list on the PHPStan page.
Use this dialog to configure the used PHP interpreter, path to the PHPStan executable file, as well as PHPStan's behaviour. For more information, refer to PHPStan.
Item | Description |
|---|---|
Interpreters pane | The left-hand pane of the dialog shows the default PHP interpreter to use the PHPStan from. To add a different interpreter, click |
PHPStan path | In this field, specify the location of the PHPStan script: phpstan.bat for Windows or phpstan for Linux and macOS. PhpStorm detects the path to the PHPStan executable file in the To check that the specified path to phpstan.bat or phpstan ensures interaction between PhpStorm and PHPStan, 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 PHPStan. If the timeout is exceeded, the process is terminated to prevent excessive CPU and memory usage. This lets you fine-tune the PHPStan process behavior depending on the configuration of your computer and the rule sets used. |