mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
parent
366f625c83
commit
3b3863f3a8
@ -567,6 +567,44 @@ class ProjectChecker
|
||||
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $paths_to_check
|
||||
* @return void
|
||||
*/
|
||||
public function checkPaths(array $paths_to_check)
|
||||
{
|
||||
foreach ($paths_to_check as $path) {
|
||||
if ($this->debug_output) {
|
||||
echo 'Checking ' . $path . "\n";
|
||||
}
|
||||
|
||||
if (is_dir($path)) {
|
||||
$this->checkDirWithConfig($path, $this->config, true);
|
||||
} elseif (is_file($path)) {
|
||||
$this->codebase->addFilesToAnalyze([$path => $path]);
|
||||
$this->config->hide_external_errors = $this->config->isInProjectDirs($path);
|
||||
}
|
||||
}
|
||||
|
||||
FileReferenceProvider::loadReferenceCache();
|
||||
|
||||
if ($this->output_format === self::TYPE_CONSOLE) {
|
||||
echo 'Scanning files...' . "\n";
|
||||
}
|
||||
|
||||
$this->config->initializePlugins($this);
|
||||
|
||||
$this->codebase->scanFiles();
|
||||
|
||||
$this->config->visitStubFiles($this->codebase, $this->debug_output);
|
||||
|
||||
if ($this->output_format === self::TYPE_CONSOLE) {
|
||||
echo 'Analyzing files...' . "\n";
|
||||
}
|
||||
|
||||
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Config
|
||||
*/
|
||||
|
@ -439,13 +439,7 @@ $start_time = (float) microtime(true);
|
||||
if ($paths_to_check === null) {
|
||||
$project_checker->check($current_dir, $is_diff);
|
||||
} elseif ($paths_to_check) {
|
||||
foreach ($paths_to_check as $path_to_check) {
|
||||
if (is_dir($path_to_check)) {
|
||||
$project_checker->checkDir($path_to_check);
|
||||
} else {
|
||||
$project_checker->checkFile($path_to_check);
|
||||
}
|
||||
}
|
||||
$project_checker->checkPaths($paths_to_check);
|
||||
}
|
||||
|
||||
if ($find_references_to) {
|
||||
|
Loading…
Reference in New Issue
Block a user