How to find the files that are the slowest to analyze with PHPStan?
For us, PHPStan became a bit slower with every release. We have a very large codebase with 10.000+ classes. There seem to be a few known issues related to big arrays.
See: phpstan/phpstan#8353 phpstan/phpstan#8146
To understand which files are problematic we run the following command:
vendor/bin/phpstan analyze --memory-limit=-1 --debug -vvv | tee phpstan.log
Then we run:
Thank you very much @ruudk.
I was able to shave off 2 minutes phpstan runtime (8 minutes to 6 minutes) by excluding
module/*/config/module.config.phpfrom the analysis in an Laminas MVC project.