mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Ignore recently-deleted files for scanning
This commit is contained in:
parent
e949ed68ac
commit
0e1ef2e096
@ -530,7 +530,7 @@ class Scanner
|
|||||||
string $file_path,
|
string $file_path,
|
||||||
array $filetype_scanners,
|
array $filetype_scanners,
|
||||||
bool $will_analyze = false
|
bool $will_analyze = false
|
||||||
): FileScanner {
|
): void {
|
||||||
$file_scanner = $this->getScannerForPath($file_path, $filetype_scanners, $will_analyze);
|
$file_scanner = $this->getScannerForPath($file_path, $filetype_scanners, $will_analyze);
|
||||||
|
|
||||||
if (isset($this->scanned_files[$file_path])
|
if (isset($this->scanned_files[$file_path])
|
||||||
@ -539,6 +539,11 @@ class Scanner
|
|||||||
throw new \UnexpectedValueException('Should not be rescanning ' . $file_path);
|
throw new \UnexpectedValueException('Should not be rescanning ' . $file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->file_provider->fileExists($file_path) && $this->config->mustBeIgnored($file_path)) {
|
||||||
|
// this should not happen, but might if the file was temporary
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$file_contents = $this->file_provider->getContents($file_path);
|
$file_contents = $this->file_provider->getContents($file_path);
|
||||||
|
|
||||||
$from_cache = $this->file_storage_provider->has($file_path, $file_contents);
|
$from_cache = $this->file_storage_provider->has($file_path, $file_contents);
|
||||||
@ -610,8 +615,6 @@ class Scanner
|
|||||||
$this->codebase->classlikes->addClassAlias($unaliased_name, $aliased_name);
|
$this->codebase->classlikes->addClassAlias($unaliased_name, $aliased_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $file_scanner;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user