mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
parent
457695e466
commit
3486490080
@ -633,6 +633,14 @@ class Config
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the hash to use for a cache folder from CLI flags and from the config file's xml contents
|
||||
*/
|
||||
public function computeHash(): string
|
||||
{
|
||||
return sha1($this->hash . ':' . $this->level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new config object from an XML string
|
||||
* @param string|null $current_dir Current working directory, if different to $base_dir
|
||||
|
@ -65,7 +65,7 @@ class ClassLikeStorageCacheProvider
|
||||
$this->modified_timestamps .= ' ' . filemtime($dependent_file_path);
|
||||
}
|
||||
|
||||
$this->modified_timestamps .= $this->config->hash;
|
||||
$this->modified_timestamps .= $this->config->computeHash();
|
||||
}
|
||||
|
||||
public function writeToCache(ClassLikeStorage $storage, ?string $file_path, ?string $file_contents): void
|
||||
|
@ -54,8 +54,9 @@ class FileReferenceCacheProvider
|
||||
|
||||
public function hasConfigChanged() : bool
|
||||
{
|
||||
$has_changed = $this->config->hash !== $this->getConfigHashCache();
|
||||
$this->setConfigHashCache($this->config->hash);
|
||||
$new_hash = $this->config->computeHash();
|
||||
$has_changed = $new_hash !== $this->getConfigHashCache();
|
||||
$this->setConfigHashCache($new_hash);
|
||||
return $has_changed;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ class FileStorageCacheProvider
|
||||
$this->modified_timestamps .= ' ' . filemtime($dependent_file_path);
|
||||
}
|
||||
|
||||
$this->modified_timestamps .= $this->config->hash;
|
||||
$this->modified_timestamps .= $this->config->computeHash();
|
||||
}
|
||||
|
||||
public function writeToCache(FileStorage $storage, string $file_contents): void
|
||||
|
Loading…
x
Reference in New Issue
Block a user