1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Add better cache clear

This commit is contained in:
Matthew Brown 2016-10-20 18:12:13 -04:00
parent d71d439e25
commit 0100ca2b8c
3 changed files with 33 additions and 3 deletions

View File

@ -1007,23 +1007,36 @@ abstract class ClassLikeChecker implements StatementsSource
public static function clearCache()
{
self::$method_checkers = [];
self::$this_class = null;
self::$class_implements = [];
self::$method_checkers = [];
self::$class_methods = [];
self::$class_checkers = [];
self::$public_class_properties = [];
self::$protected_class_properties = [];
self::$private_class_properties = [];
self::$public_static_class_properties = [];
self::$protected_static_class_properties = [];
self::$private_static_class_properties = [];
self::$public_class_constants = [];
self::$registered_classes = [];
self::$class_implements = [];
self::$class_files = [];
self::$file_classes = [];
ClassChecker::clearCache();
InterfaceChecker::clearCache();
}

View File

@ -638,5 +638,6 @@ class FileChecker implements StatementsSource
self::$files_checked = [];
ClassLikeChecker::clearCache();
FunctionChecker::clearCache();
}
}

View File

@ -467,4 +467,20 @@ class FunctionChecker extends FunctionLikeChecker
return self::$call_map;
}
public static function clearCache()
{
self::$function_return_types = [];
self::$function_namespaces = [];
self::$existing_functions = [];
self::$deprecated_functions = [];
self::$have_registered_function = [];
self::$file_function_params = [];
self::$variadic_functions = [];
self::$builtin_function_params = [];
self::$builtin_functions = [];
}
}