当前位置: 首页>>代码示例>>PHP>>正文


PHP Issue::getNameForCategory方法代码示例

本文整理汇总了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()]]];
 }
开发者ID:ablyler,项目名称:phan,代码行数:5,代码来源:CodeClimatePrinter.php

示例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()]);
 }
开发者ID:tpunt,项目名称:phan,代码行数:5,代码来源:CSVPrinter.php

示例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);
     }
 }
开发者ID:actank,项目名称:phan,代码行数:50,代码来源:Log.php


注:本文中的Phan\Issue::getNameForCategory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。