From 97eae625e9a33422077825f98eaee99404a9a186 Mon Sep 17 00:00:00 2001 From: Andrew Nagy Date: Thu, 2 Mar 2023 19:12:29 +0000 Subject: [PATCH] fixes --- .../Provider/ClassLikeStorageCacheProvider.php | 7 +++++-- .../Provider/ParserCacheProvider.php | 15 +++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Psalm/Internal/LanguageServer/Provider/ClassLikeStorageCacheProvider.php b/src/Psalm/Internal/LanguageServer/Provider/ClassLikeStorageCacheProvider.php index 88c072348..f1925fe79 100644 --- a/src/Psalm/Internal/LanguageServer/Provider/ClassLikeStorageCacheProvider.php +++ b/src/Psalm/Internal/LanguageServer/Provider/ClassLikeStorageCacheProvider.php @@ -26,8 +26,11 @@ class ClassLikeStorageCacheProvider extends InternalClassLikeStorageCacheProvide $this->cache[$fq_classlike_name_lc] = $storage; } - public function getLatestFromCache(string $fq_classlike_name_lc, ?string $file_path, ?string $file_contents): ClassLikeStorage - { + public function getLatestFromCache( + string $fq_classlike_name_lc, + ?string $file_path, + ?string $file_contents + ): ClassLikeStorage { $cached_value = $this->loadFromCache($fq_classlike_name_lc); if (!$cached_value) { diff --git a/src/Psalm/Internal/LanguageServer/Provider/ParserCacheProvider.php b/src/Psalm/Internal/LanguageServer/Provider/ParserCacheProvider.php index 07218dce5..0b30a2dda 100644 --- a/src/Psalm/Internal/LanguageServer/Provider/ParserCacheProvider.php +++ b/src/Psalm/Internal/LanguageServer/Provider/ParserCacheProvider.php @@ -36,8 +36,11 @@ class ParserCacheProvider extends InternalParserCacheProvider { } - public function loadStatementsFromCache(string $file_path, int $file_modified_time, string $file_content_hash): ?array - { + public function loadStatementsFromCache( + string $file_path, + int $file_modified_time, + string $file_content_hash + ): ?array { if (isset($this->statements_cache[$file_path]) && $this->statements_cache_time[$file_path] >= $file_modified_time && $this->file_content_hash[$file_path] === $file_content_hash @@ -63,8 +66,12 @@ class ParserCacheProvider extends InternalParserCacheProvider /** * @param list $stmts */ - public function saveStatementsToCache(string $file_path, string $file_content_hash, array $stmts, bool $touch_only): void - { + public function saveStatementsToCache( + string $file_path, + string $file_content_hash, + array $stmts, + bool $touch_only + ): void { $this->statements_cache[$file_path] = $stmts; $this->statements_cache_time[$file_path] = microtime(true); $this->file_content_hash[$file_path] = $file_content_hash;