Setting the file. One moment.
Subchapter 12.1
references/configuration.mdMarkdown1 KBView on GitHub
This reference documents a minimal, WordPress-friendly PHPStan setup and baseline workflow.
phpstan.neon templateUse the repo’s existing layout. The example below is intentionally conservative and should be adapted to the project’s actual directories.
# Include the baseline only if the file exists.
includes:
- phpstan-baseline.neon
parameters:
level: 5
paths:
- src/
- includes/
excludePaths:
- vendor/
- vendor-prefixed/
- node_modules/
- tests/
ignoreErrors:
# Add targeted exceptions only when necessary.Guidelines:
ignoreErrors patterns narrow and grouped by dependency.Baselines help you adopt PHPStan in legacy code without accepting new regressions.
# Generate a baseline (explicit filename)
vendor/bin/phpstan analyse --generate-baseline phpstan-baseline.neon
# Update an existing baseline (defaults)
vendor/bin/phpstan analyse --generate-baselineBest practices: