Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>vscode-phpstanNew to Visual Studio Code? Get it now.
vscode-phpstan

vscode-phpstan

Calvin Baart

|
14,569 installs
| (4) | Free
PHPStan support in VSCode
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info


Image Sample 1

What is this?

PHPStan is a static analysis tool for PHP. This extension integrates the output of PHPStan in VSCode allowing the developer to find errors quicker.

Installation

PHPStan is required to use this extension. By default the plugin will search the global vendor folder and the workspace vendor folders. The COMPOSER_HOME environment variable can be set to change where the plugin searches. This path can be manually set using the phpstan.path setting.

PHPStan can be installed globally using:

composer global require phpstan/phpstan

or locally using:

composer require --dev phpstan/phpstan

Commands

PHPStan includes an explorer-context command called "PHPStan: Scan for Errors". This command works on both directories and files.


Image Sample 2

Configuration

vscode-phpstan provides the following configuration properties and defaults:

"phpstan.enabled": true,
"phpstan.path": null,
"phpstan.level": "max",
"phpstan.memoryLimit": "2048M",
"phpstan.projectFile": null,
"phpstan.excludeFiles": [],
"phpstan.options": []

<workspacefolder>/phpstan.neon and <workspacefolder>/phpstan.neon.dist will be used when phpstan.projectFile is set to null. phpstan.options can be used to pass extra parameters to the phpstan commandline call.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft