Menu

[r241]: / trunk / src / reporter / Reporters.php  Maximize  Restore  History

Download this file

69 lines (60 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
require_once PHPCHECKSTYLE_HOME_DIR."/src/reporter/Reporter.php";
/**
* Class used to handle multiple reporters.
*/
class Reporters {
// The list of registered reporters.
private $reporters = array();
/**
* Add a reporter to the list of registered reporters.
*
* @param Reporter $reported a Reporter
*/
public function addReporter($reported) {
$this->reporters[] = $reported;
}
/**
* Any initialization before starting to write should be done here
*/
public function start() {
foreach ($this->reporters as $reporter) {
$reporter->start();
}
}
/**
* Any cleanup work before closing should be done here.
*/
public function stop() {
foreach ($this->reporters as $reporter) {
$reporter->stop();
}
}
/**
* this function called everytime a new file has been started for
* checkstyle processing.
*
* @param $phpFile new file's name
*/
public function currentlyProcessing($phpFile) {
foreach ($this->reporters as $reporter) {
$reporter->currentlyProcessing($phpFile);
}
}
/**
* For every error, this function is called once with the line where
* the error occurred and the actual error message
* It is the responsibility of the derived class to appropriately
* format it and write it into the output file
*
* @param $line line number of the error
* @param String $check the name of the check
* @param $message error message
* @param $level the severity level
*/
public function writeError($line, $check, $message, $level = WARNING) {
foreach ($this->reporters as $reporter) {
$reporter->writeError($line, $check, $message, $level);
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.