LinuxmacOS

Where Does PHPStan Store Config and Cache?

PHPStan reads phpstan.neon per project for level and paths, caching analysis in tmp beside it with baselines for legacy debt.

Last updated

PHPStan centers per project config in a neon file naming level, analysed paths, and ignore rules. Result caches beside it remember file hashes to skip unchanged code.

Cache staleness causes phantom errors after big refactors. Clearing tmp restores truth at the cost of one slow run. Config stays small while caches stay disposable.

Where PHPStan stores this, by platform

Linux
phpstan.neon + tmp/

Level plus paths config versioned per project. Result cache beside it speeds reruns. Clear on phantom errors.

macOS
phpstan.neon + tmp/

Same repo relative pair on Mac installs. Baselines commit beside config. Ignore tmp outputs.

Frequently asked questions

How do I clear the PHPStan cache?

Delete the result cache directory to force full reanalysis when findings look stale. Version bumps invalidate automatically most times.

How do I share PHPStan config?

Commit phpstan.neon with level, paths, and ignores while gitignoring tmp outputs. Baselines version beside it for legacy code.

Notice an outdated path? Let us know.