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

Fix possibly null property

This commit is contained in:
Matthew Brown 2019-04-14 13:04:25 -04:00
parent 934fb53d65
commit c297b91d6f
2 changed files with 7 additions and 4 deletions

View File

@ -87,7 +87,7 @@ class Config
/**
* The directory to store all Psalm project caches
*
* @var string
* @var string|null
*/
public $global_cache_directory;
@ -1303,7 +1303,7 @@ class Config
}
/**
* @return string
* @return ?string
*/
public function getGlobalCacheDirectory()
{

View File

@ -474,8 +474,11 @@ if (isset($options['clear-cache'])) {
if (isset($options['clear-global-cache'])) {
$cache_directory = $config->getGlobalCacheDirectory();
Config::removeCacheDirectory($cache_directory);
echo 'Global cache directory deleted' . PHP_EOL;
if ($cache_directory) {
Config::removeCacheDirectory($cache_directory);
echo 'Global cache directory deleted' . PHP_EOL;
}
exit;
}