~ubuntu-branches/ubuntu/wily/phabricator/wily

« back to all changes in this revision

Viewing changes to src/lint/renderer/ArcanistCompilerLikeLintRenderer.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2014-11-01 23:20:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: package-import@ubuntu.com-20141101232006-mvlnp0cil67tsboe
Tags: upstream-0~git20141101/arcanist
Import upstream version 0~git20141101, component arcanist

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * Shows lint messages to the user.
 
5
 */
 
6
final class ArcanistCompilerLikeLintRenderer extends ArcanistLintRenderer {
 
7
 
 
8
  public function renderLintResult(ArcanistLintResult $result) {
 
9
    $lines = array();
 
10
    $messages = $result->getMessages();
 
11
    $path = $result->getPath();
 
12
 
 
13
    foreach ($messages as $message) {
 
14
      $severity = ArcanistLintSeverity::getStringForSeverity(
 
15
        $message->getSeverity());
 
16
      $line = $message->getLine();
 
17
      $code = $message->getCode();
 
18
      $description = $message->getDescription();
 
19
      $lines[] = sprintf(
 
20
        "%s:%d:%s (%s) %s\n",
 
21
        $path,
 
22
        $line,
 
23
        $severity,
 
24
        $code,
 
25
        $description);
 
26
    }
 
27
 
 
28
    return implode('', $lines);
 
29
  }
 
30
 
 
31
  public function renderOkayResult() {
 
32
    return '';
 
33
  }
 
34
 
 
35
}