To run scripts using composer update the scripts
section in composer.json
//..
"scripts": {
"test-stan": "phpstan",
"test-unit": "phpunit --colors=always tests",
"test-lint": "phpcs --standard=coding_standard.xml common.php tests public config",
"clean": "phpcbf --standard=coding_standard.xml common.php tests public config",
"test": [
"@test-lint",
"@test-stan",
"@test-unit"
]
},
//..
Now run composer test-stan
to run phpstan. Multiple scripts can be ran by using an array
"test": [
"@test-lint",
"@test-stan",
"@test-unit"
]