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:
parent
7e54c5172d
commit
5c73d77f28
@ -111,12 +111,6 @@
|
|||||||
</errorLevel>
|
</errorLevel>
|
||||||
</PossiblyUnusedProperty>
|
</PossiblyUnusedProperty>
|
||||||
|
|
||||||
<UnusedMethod>
|
|
||||||
<errorLevel type="suppress">
|
|
||||||
<referencedMethod name="Psalm\Internal\Analyzer\ProjectAnalyzer::getAllFiles"/>
|
|
||||||
</errorLevel>
|
|
||||||
</UnusedMethod>
|
|
||||||
|
|
||||||
<PossiblyUnusedMethod>
|
<PossiblyUnusedMethod>
|
||||||
<errorLevel type="suppress">
|
<errorLevel type="suppress">
|
||||||
<directory name="src/Psalm/Plugin"/>
|
<directory name="src/Psalm/Plugin"/>
|
||||||
@ -134,8 +128,6 @@
|
|||||||
<referencedMethod name="Psalm\Codebase::createClassLikeStorage"/>
|
<referencedMethod name="Psalm\Codebase::createClassLikeStorage"/>
|
||||||
<referencedMethod name="Psalm\Codebase::isVariadic"/>
|
<referencedMethod name="Psalm\Codebase::isVariadic"/>
|
||||||
<referencedMethod name="Psalm\Codebase::getMethodReturnsByRef"/>
|
<referencedMethod name="Psalm\Codebase::getMethodReturnsByRef"/>
|
||||||
<referencedMethod name="Psalm\Internal\Provider\ParserCacheProvider::processSuccessfulRun"/>
|
|
||||||
<referencedMethod name="Psalm\Internal\Provider\ParserCacheProvider::touchParserCaches"/>
|
|
||||||
</errorLevel>
|
</errorLevel>
|
||||||
</PossiblyUnusedMethod>
|
</PossiblyUnusedMethod>
|
||||||
|
|
||||||
|
@ -1066,25 +1066,6 @@ class ProjectAnalyzer
|
|||||||
$this->codebase->addFilesToAnalyze($files_to_scan);
|
$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
|
public function addProjectFile(string $file_path): void
|
||||||
{
|
{
|
||||||
$this->project_files[$file_path] = $file_path;
|
$this->project_files[$file_path] = $file_path;
|
||||||
|
@ -349,61 +349,6 @@ class ParserCacheProvider
|
|||||||
return $removed_count;
|
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
|
private function getParserCacheKey(string $file_name): string
|
||||||
{
|
{
|
||||||
return md5($file_name) . ($this->use_igbinary ? '-igbinary' : '') . '-r';
|
return md5($file_name) . ($this->use_igbinary ? '-igbinary' : '') . '-r';
|
||||||
|
Loading…
Reference in New Issue
Block a user