~ubuntu-branches/ubuntu/vivid/phabricator/vivid-proposed

« back to all changes in this revision

Viewing changes to arcanist/src/lint/engine/UnitTestableArcanistLintEngine.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2014-10-23 20:49:26 UTC
  • mfrom: (0.2.1) (0.1.1)
  • Revision ID: package-import@ubuntu.com-20141023204926-vq80u1op4df44azb
Tags: 0~git20141023-1
Initial release (closes: #703046)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * Lint engine for use in constructing test cases. See
 
5
 * @{class:ArcanistLinterTestCase}.
 
6
 */
 
7
final class UnitTestableArcanistLintEngine extends ArcanistLintEngine {
 
8
 
 
9
  protected $linters = array();
 
10
 
 
11
  public function addLinter($linter) {
 
12
    $this->linters[] = $linter;
 
13
    return $this;
 
14
  }
 
15
 
 
16
  public function addFileData($path, $data) {
 
17
    $this->fileData[$path] = $data;
 
18
    return $this;
 
19
  }
 
20
 
 
21
  public function pathExists($path) {
 
22
    if (idx($this->fileData, $path)) {
 
23
      return true;
 
24
    }
 
25
    return parent::pathExists($path);
 
26
  }
 
27
 
 
28
  protected function buildLinters() {
 
29
    return $this->linters;
 
30
  }
 
31
 
 
32
}