1: First, you may use npm to install phpstan-watcher globally:
npm i -g phpstan-watcher
2: Then, install phpstan and/or larastan
3: Important: create script shortcuts in composer.json
"analyse": [
"./vendor/bin/phpstan analyse"
],
"analyse-json": [
"./vendor/bin/phpstan analyse --error-format=json"
]
4: Finally, start phpstan-watcher in the root of your project folder
npm exec phpstan-watcher
or
npx phpstan-watcher
For the notifications to work : on mac you should allow terminal notifications
Phpstan-watcher is an open-sourced software licensed under the ISC License.
Tim Vande Walle