mirror of
https://github.com/danog/psalm.git
synced 2024-12-03 10:07:52 +01:00
fixes
This commit is contained in:
parent
7760c399cc
commit
97eae625e9
@ -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) {
|
||||
|
@ -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<PhpParser\Node\Stmt> $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;
|
||||
|
Loading…
Reference in New Issue
Block a user