dep: update phan

This commit is contained in:
2021-10-12 01:36:02 +09:00
parent cf3f40b578
commit 2a386e9c8b
131 changed files with 4268 additions and 2452 deletions
+2 -8
View File
@@ -395,7 +395,7 @@ class PhanPHPLinterOpts
/**
* @param string $msg - optional message
* @param int $exit_code - process exit code.
* @return void - exits with $exit_code
* @return never - exits with $exit_code
*/
public function usage($msg = '', $exit_code = 0)
{
@@ -537,7 +537,6 @@ EOB;
}
if (!is_string($value)) {
$this->usage('--flycheck-file should be passed a string value', 1);
break; // unreachable
}
$this->temporary_file_map = [$this->file_list[0] => $value];
break;
@@ -549,7 +548,6 @@ EOB;
$mapping = json_decode($value, true);
if (!\is_array($mapping)) {
$this->usage('--temporary-file-map should be a JSON encoded map from source file to temporary file to analyze instead', 1);
break; // unreachable
}
$this->temporary_file_map = $mapping;
@@ -574,19 +572,17 @@ EOB;
if (!is_string($path)) {
$this->print_usage_on_error = $print_usage_on_error;
$this->usage(sprintf("Error: asked to analyze path %s which is not a string", json_encode($path) ?: 'invalid'), 1);
exit(1);
}
if (!file_exists($path)) {
$this->print_usage_on_error = $print_usage_on_error;
$this->usage(sprintf("Error: asked to analyze file %s which does not exist", json_encode($path) ?: 'invalid'), 1);
exit(1);
}
$this->file_list[] = $path;
break;
case 'h':
case 'help':
// never returns
$this->usage();
break;
case 'd':
case 'disable-usage-on-error':
$print_usage_on_error = false;
@@ -604,7 +600,6 @@ EOB;
case 'output-mode':
if (!is_string($value) || !in_array($value, ['text', 'json', 'csv', 'codeclimate', 'checkstyle', 'pylint', 'phan_client'], true)) {
$this->usage("Expected --output-mode {text,json,csv,codeclimate,checkstyle,pylint}, but got " . json_encode($value), 1);
break; // unreachable
}
if ($value === 'phan_client') {
// We're requesting the default
@@ -614,7 +609,6 @@ EOB;
break;
default:
$this->usage("Unknown option '-$key'", 1);
break;
}
}
try {