PhpStorm 2026.2 Help

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 the Browse button to the right of the drop-down list opens PHPStan Dialog.

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.

  • 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 PHPStan 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.

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 --tmp-file and --instead-of CLI options, replacing project files that are being edited with temporary file versions.

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 (500M, 4G, and so on).

Run mode

Configure how often PHPStan is triggered to analyze code:

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

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

  • On save – PHPStan 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 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 the Browse button 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 the Add button and select an item from the list of CLI interpreters configured in the project.

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 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 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 phpstan --version command. If validation passes successfully, PhpStorm displays the information on the detected PHPStan version.

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.

29 May 2026