1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Merge pull request #6213 from weirdan/scan-preloaded-stubs-earlier

Scan preloaded stubs earlier
This commit is contained in:
Bruce Weirdan 2021-08-01 01:52:04 +03:00 committed by GitHub
commit edffb1a02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -582,6 +582,7 @@ class ProjectAnalyzer
|| $deleted_files === null
|| count($diff_files) > 200
) {
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->visitAutoloadFiles();
$this->codebase->scanner->addFilesToShallowScan($this->extra_files);
@ -590,8 +591,6 @@ class ProjectAnalyzer
$this->config->initializePlugins($this);
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->codebase->scanFiles($this->threads);
$this->codebase->infer_types_from_usage = true;
@ -608,14 +607,13 @@ class ProjectAnalyzer
$file_list = array_diff($file_list, $deleted_files);
if ($file_list) {
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->visitAutoloadFiles();
$this->checkDiffFilesWithConfig($this->config, $file_list);
$this->config->initializePlugins($this);
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->codebase->scanFiles($this->threads);
} else {
$diff_no_files = true;
@ -989,14 +987,14 @@ class ProjectAnalyzer
{
$this->file_reference_provider->loadReferenceCache();
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->checkDirWithConfig($dir_name, $this->config, true);
$this->progress->startScanningFiles();
$this->config->initializePlugins($this);
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->codebase->scanFiles($this->threads);
$this->config->visitStubFiles($this->codebase, $this->progress);
@ -1116,6 +1114,8 @@ class ProjectAnalyzer
{
$this->progress->debug('Checking ' . $file_path . "\n");
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->config->hide_external_errors = $this->config->isInProjectDirs($file_path);
$this->codebase->addFilesToAnalyze([$file_path => $file_path]);
@ -1126,8 +1126,6 @@ class ProjectAnalyzer
$this->config->initializePlugins($this);
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->codebase->scanFiles($this->threads);
$this->config->visitStubFiles($this->codebase, $this->progress);
@ -1147,6 +1145,7 @@ class ProjectAnalyzer
*/
public function checkPaths(array $paths_to_check): void
{
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->visitAutoloadFiles();
$this->codebase->scanner->addFilesToShallowScan($this->extra_files);
@ -1168,7 +1167,6 @@ class ProjectAnalyzer
$this->config->initializePlugins($this);
$this->config->visitPreloadedStubFiles($this->codebase, $this->progress);
$this->codebase->scanFiles($this->threads);