本文整理汇总了PHP中Phan\Issue::getNameForCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::getNameForCategory方法的具体用法?PHP Issue::getNameForCategory怎么用?PHP Issue::getNameForCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phan\Issue
的用法示例。
在下文中一共展示了Issue::getNameForCategory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print
/** @param IssueInstance $instance */
public function print(IssueInstance $instance)
{
$this->messages[] = ['type' => 'issue', 'check_name' => $instance->getIssue()->getType(), 'description' => Issue::getNameForCategory($instance->getIssue()->getCategory()) . ' ' . $instance->getIssue()->getType() . ' ' . $instance->getMessage(), 'categories' => ['Bug Risk'], 'severity' => self::mapSeverity($instance->getIssue()->getSeverity()), 'location' => ['path' => preg_replace('/^\\/code\\//', '', $instance->getFile()), 'lines' => ['begin' => $instance->getLine(), 'end' => $instance->getLine()]]];
}
示例2: print
/** @param IssueInstance $instance */
public function print(IssueInstance $instance)
{
fputcsv($this->stream, [$instance->getFile(), $instance->getLine(), $instance->getIssue()->getSeverity(), $instance->getIssue()->getSeverityName(), Issue::getNameForCategory($instance->getIssue()->getCategory()), $instance->getIssue()->getType(), $instance->getMessage()]);
}
示例3: display
public static function display(array $summary = [])
{
$log = self::getInstance();
$out = '';
$print_closure = function (string $message) {
print $message;
};
$fp = null;
if (!empty($log->output_filename)) {
$fp = fopen($log->output_filename, "w");
$print_closure = function ($message) use($fp) {
fputs($fp, $message);
};
} else {
if (Config::get()->progress_bar) {
fwrite(STDERR, "\n");
}
}
// Sort messages by file name and line number in
// ascending order
ksort($log->msgs);
switch ($log->output_mode) {
case 'text':
foreach ($log->msgs as $e) {
$print_closure("{$e['file']}:{$e['lineno']}" . " {$e['type']}" . " {$e['message']}\n");
}
break;
case 'codeclimate':
foreach ($log->msgs as $e) {
$severity = 'info';
switch ($e['severity']) {
case Issue::SEVERITY_CRITICAL:
$severity = 'critical';
break;
case Issue::SEVERITY_NORMAL:
$severity = 'normal';
break;
case Issue::SEVERITY_LOW:
$severity = 'info';
break;
}
$print_closure(json_encode(['type' => 'issue', 'check_name' => $e['type'], 'description' => Issue::getNameForCategory($e['category']) . ' ' . $e['type'] . ' ' . $e['message'], 'categories' => ['Bug Risk'], 'severity' => $severity, 'location' => ['path' => preg_replace('/^\\/code\\//', '', $e['file']), 'lines' => ['begin' => $e['lineno'], 'end' => $e['lineno']]]], JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE) . chr(0));
}
break;
}
$log->msgs = [];
if ($fp) {
fclose($fp);
}
}