Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make PhpStorm check the current PHP file on save.

PhpStorm + PhpStan watcher

PhpStorm - Settings - Tools - File Watchers (create new)

  • File type: PHP
  • Scope: Project files
  • Program (wherever your phpstan is located, obvs.): $ContentRoot$/vendor/phpstan/phpstan/bin/phpstan
  • Arguments: analyse $FilePath$
  • Working directory (this is probably the directory with phpstan.neon): $ContentRoot$
  • Show console: on error
  • Output filters: Failed to save key (else you'll get zillion cache notices)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment