Open TysonAndre opened 5 years ago
Happy to accept a PR - I think it's just a matter of changing the calls to Codebase::scanFiles
in ProjectAnalyzer
.
Alternatively there could be some way of a plugin specifying that it should run scanning in a single process, which would probably make a bit more sense thinking about it.
Either via the CLI (
--no-parallel-scan
?), or via an API that plugins can use.The scan phase is usually fast for full program analysis
Use case: I'm writing a plugin that scans information about class constant declarations during the scan phase, to make Psalm treat a method as if a parameter has a certain array shape. A simplified version of the plugin is https://github.com/TysonAndre/psalm/blob/master/examples/plugins/APIFilterPlugin.php (it doesn't scan the codebase, though)
E.g. it might need to know that
SomeFilterClass::some_method
returnsint
to affect the inferred array shape for the parameters forSomeAPIClass::other_method