blob: 1fa8bcb635b1ea185a562a386d642fc58de3cd18 (
plain)
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
|
<?php
namespace phorkie;
class Tool_Result_Line
{
public $message;
public $level;
public function __construct($message, $level = 'ok')
{
$this->message = $message;
$this->setLevel($level);
}
public function setLevel($level)
{
if ($level !== 'ok' && $level !== 'error' && $level !== 'warning') {
throw new Exception('Invalid result line level: ' . $level);
}
$this->level = $level;
}
public function getAlertLevel()
{
static $map = array(
'error' => 'alert-error',
'ok' => 'alert-success',
'warning' => '',
);
return $map[$this->level];
}
}
?>
|