1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00

Remove unused methods

This commit is contained in:
Tomasz Mlynski 2021-12-06 18:16:07 +01:00
parent 7e54c5172d
commit 5c73d77f28
No known key found for this signature in database
GPG Key ID: 665B4A17698A1954
3 changed files with 0 additions and 82 deletions

View File

@ -111,12 +111,6 @@
</errorLevel>
</PossiblyUnusedProperty>
<UnusedMethod>
<errorLevel type="suppress">
<referencedMethod name="Psalm\Internal\Analyzer\ProjectAnalyzer::getAllFiles"/>
</errorLevel>
</UnusedMethod>
<PossiblyUnusedMethod>
<errorLevel type="suppress">
<directory name="src/Psalm/Plugin"/>
@ -134,8 +128,6 @@
<referencedMethod name="Psalm\Codebase::createClassLikeStorage"/>
<referencedMethod name="Psalm\Codebase::isVariadic"/>
<referencedMethod name="Psalm\Codebase::getMethodReturnsByRef"/>
<referencedMethod name="Psalm\Internal\Provider\ParserCacheProvider::processSuccessfulRun"/>
<referencedMethod name="Psalm\Internal\Provider\ParserCacheProvider::touchParserCaches"/>
</errorLevel>
</PossiblyUnusedMethod>

View File

@ -1066,25 +1066,6 @@ class ProjectAnalyzer
$this->codebase->addFilesToAnalyze($files_to_scan);
}
/**
* @return list<string>
* @deprecated going to be removed in Psalm 5
*/
private function getAllFiles(Config $config): array
{
$file_extensions = $config->getFileExtensions();
$file_paths = [];
foreach ($config->getProjectDirectories() as $dir_name) {
$file_paths = array_merge(
$file_paths,
$this->file_provider->getFilesInDir($dir_name, $file_extensions)
);
}
return $file_paths;
}
public function addProjectFile(string $file_path): void
{
$this->project_files[$file_path] = $file_path;

View File

@ -349,61 +349,6 @@ class ParserCacheProvider
return $removed_count;
}
/**
* @deprecated going to be removed in Psalm 5
*/
public function processSuccessfulRun(): void
{
$cache_directory = Config::getInstance()->getCacheDirectory();
if (!$cache_directory) {
return;
}
$cache_directory .= DIRECTORY_SEPARATOR . self::PARSER_CACHE_DIRECTORY;
if (is_dir($cache_directory)) {
$directory_files = scandir($cache_directory, SCANDIR_SORT_NONE);
foreach ($directory_files as $directory_file) {
$full_path = $cache_directory . DIRECTORY_SEPARATOR . $directory_file;
if ($directory_file[0] === '.') {
continue;
}
touch($full_path);
}
}
}
/**
* @param array<string> $file_names
* @deprecated going to be removed in Psalm 5
*/
public function touchParserCaches(array $file_names, int $min_time): void
{
$cache_directory = Config::getInstance()->getCacheDirectory();
if (!$cache_directory) {
return;
}
$cache_directory .= DIRECTORY_SEPARATOR . self::PARSER_CACHE_DIRECTORY;
if (is_dir($cache_directory)) {
foreach ($file_names as $file_name) {
$hash_file_name = $cache_directory . DIRECTORY_SEPARATOR . $this->getParserCacheKey($file_name);
if (file_exists($hash_file_name)) {
if (filemtime($hash_file_name) < $min_time) {
touch($hash_file_name, $min_time);
}
}
}
}
}
private function getParserCacheKey(string $file_name): string
{
return md5($file_name) . ($this->use_igbinary ? '-igbinary' : '') . '-r';