Cache files in OptimizedDirectorySourceLocatorFactory by staabm · Pull Request #4577 · phpstan/phpstan-src

shot in the dark for the problem seen in phpstan/phpstan#13852


This PR adds caching when called with a array of files.

Before this PR the existing caching did only work for directories.

I tried this PR on the phpunit codebase, which proofed that with this change the numer pf findSymbols calls will be reduced to the files actually changed. Unrelated files (like bootstrap files) will no longer be processed for symbols)


this PR combined with #4576 I can see the phpstan test-suite running with php tests/vendor/bin/paratest in 38-40 seconds