Skip to content

Instantly share code, notes, and snippets.

@Piskvor
Created September 27, 2019 12:38
Show Gist options
  • Save Piskvor/3a64d985766a17257279f71402d9d51c to your computer and use it in GitHub Desktop.
Save Piskvor/3a64d985766a17257279f71402d9d51c to your computer and use it in GitHub Desktop.
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