composer require --dev phpstan/phpstan
phpstan.neon
:
parameters:
paths:
- path/to/subfolder/
excludePaths:
- ~/.vscode-server/*
- '/root/.vscode-server/extensions/*'
level: 3
composer require --dev "larastan/larastan:^2.0"
phpstan.neon
:
includes:
- vendor/larastan/larastan/extension.neon
parameters:
paths:
- app/
- config/
- database/
- routes/
- tests/
excludePaths:
- ~/.vs-code-server/*
- '/root/.vscode-server/extensions/*'
level: 3
composer require --dev szepeviktor/phpstan-wordpress
phpstan.neon
:
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters:
paths:
#- wp-config/themes/blank/
- ./
excludePaths:
- ~/.vscode-server/*
- '/root/.vscode-server/extensions/*'
level: 3
# without config
./vendor/bin/phpstan analyse src tests
./vendor/bin/phpstan analyse --level 5 src tests
./vendor/bin/phpstan analyse --generate-baseline src tests
# with config
./vendor/bin/phpstan analyse
./vendor/bin/phpstan analyse --memory-limit=2G
./vendor/bin/phpstan clear-result-cache # sometimes (especially when using wsl, the cache gets stale and changes don't reflext)
- https://marketplace.visualstudio.com/items?itemName=SanderRonde.phpstan-vscode
- runs on every file change and shows errors in tab "Problems"
- useful plugin setting:
- enable "single file mode"