mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Invalidate cached methods when referenced files are deleted
This commit is contained in:
parent
474f8874f0
commit
1161edfa33
@ -687,6 +687,16 @@ class Analyzer
|
||||
}
|
||||
}
|
||||
|
||||
// This could be optimized by storing method references to files
|
||||
foreach ($file_reference_provider->getDeletedReferencedFiles() as $deleted_file) {
|
||||
foreach ($file_reference_provider->getFilesReferencingFile($deleted_file) as $file_referencing_deleted) {
|
||||
$methods_referencing_deleted = $this->analyzed_methods[$file_referencing_deleted] ?? [];
|
||||
foreach ($methods_referencing_deleted as $method_referencing_deleted => $_) {
|
||||
$newly_invalidated_methods[$method_referencing_deleted] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($newly_invalidated_methods as $method_id => $_) {
|
||||
foreach ($method_references_to_class_members as $i => $_) {
|
||||
unset($method_references_to_class_members[$i][$method_id]);
|
||||
|
Loading…
Reference in New Issue
Block a user