/**
* @param int $category
* The category of error such as `Issue::CATEGORY_UNDEFINED`
*
* @param string $type
* The error type such as `Issue::UndeclaredMethod`
*
* @param int $severity
* The severity of the issue such as `Issue::SEVERITY_NORMAL`
*
* @param string $message
* The error message
*
* @param string $file
* The name of the file with the issue
*
* @param int $lineno
* The line number where the issue occurs
*/
public static function err(int $category, string $type, int $severity, string $message, string $file, int $lineno)
{
$log = self::getInstance();
// Don't report anything for excluded files
if (Phan::isExcludedAnalysisFile($file)) {
return;
}
// Don't report anything below our minimum severity
// threshold
if ($severity < Config::get()->minimum_severity) {
return;
}
if ($category & $log->output_mask) {
// This needs to be a sortable key so that output
// is in the expected order
$ukey = implode('|', [$file, str_pad((string) $lineno, 5, '0', STR_PAD_LEFT), $type, $message]);
$log->msgs[$ukey] = ['file' => $file, 'lineno' => $lineno, 'category' => $category, 'type' => $type, 'severity' => $severity, 'message' => $message];
}
}