1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Fix #965 - invalidate cache when changing plugins

This commit is contained in:
Matt Brown 2018-09-04 15:28:03 -04:00
parent b97972ebb3
commit add7c14b44
3 changed files with 9 additions and 1 deletions

View File

@ -224,7 +224,7 @@ class Config
/** /**
* @var string[] * @var string[]
*/ */
private $plugin_paths = []; public $plugin_paths = [];
/** /**
* Static methods to be called after method checks have completed * Static methods to be called after method checks have completed

View File

@ -31,6 +31,10 @@ class ClassLikeStorageCacheProvider
$storage_dir . 'MethodStorage.php', $storage_dir . 'MethodStorage.php',
]; ];
if ($config->after_visit_classlikes) {
$dependent_files = array_merge($dependent_files, $config->plugin_paths);
}
foreach ($dependent_files as $dependent_file_path) { foreach ($dependent_files as $dependent_file_path) {
if (!file_exists($dependent_file_path)) { if (!file_exists($dependent_file_path)) {
throw new \UnexpectedValueException($dependent_file_path . ' must exist'); throw new \UnexpectedValueException($dependent_file_path . ' must exist');

View File

@ -32,6 +32,10 @@ class FileStorageCacheProvider
$storage_dir . 'FunctionLikeParameter.php', $storage_dir . 'FunctionLikeParameter.php',
]; ];
if ($config->after_visit_classlikes) {
$dependent_files = array_merge($dependent_files, $config->plugin_paths);
}
foreach ($dependent_files as $dependent_file_path) { foreach ($dependent_files as $dependent_file_path) {
if (!file_exists($dependent_file_path)) { if (!file_exists($dependent_file_path)) {
throw new \UnexpectedValueException($dependent_file_path . ' must exist'); throw new \UnexpectedValueException($dependent_file_path . ' must exist');