| 1 | <?php |
||
| 12 | class FileMessage { |
||
| 13 | |||
| 14 | const LEVEL_NOTICE = 0; |
||
| 15 | |||
| 16 | const LEVEL_ERROR = 1; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var int |
||
| 20 | */ |
||
| 21 | private $level; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var FileInfo |
||
| 25 | */ |
||
| 26 | private $file; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | private $text; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var array |
||
| 35 | */ |
||
| 36 | private static $levelMap = [ |
||
| 37 | self::LEVEL_NOTICE => 'notice', |
||
| 38 | self::LEVEL_ERROR => 'error', |
||
| 39 | ]; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var FileTool |
||
| 43 | */ |
||
| 44 | private $tool; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var int|null |
||
| 48 | */ |
||
| 49 | private $line; |
||
| 50 | |||
| 51 | |||
| 52 | /** |
||
| 53 | * @param FileInfo $file |
||
| 54 | * @param FileTool $tool |
||
| 55 | * @param $text |
||
| 56 | * @param int|null $line |
||
| 57 | * @param int $level |
||
| 58 | */ |
||
| 59 | 8 | public function __construct(FileInfo $file, FileTool $tool, $text, $line, $level = null) { |
|
| 73 | |||
| 74 | |||
| 75 | /** |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | public function getText() { |
||
| 81 | |||
| 82 | |||
| 83 | /** |
||
| 84 | * @return FileInfo |
||
| 85 | */ |
||
| 86 | public function getFile() { |
||
| 89 | |||
| 90 | |||
| 91 | /** |
||
| 92 | * @return int|null |
||
| 93 | */ |
||
| 94 | 3 | public function getLine() { |
|
| 95 | 3 | return $this->line; |
|
| 96 | } |
||
| 97 | |||
| 98 | |||
| 99 | /** |
||
| 100 | * @return int |
||
| 101 | */ |
||
| 102 | public function getLevel() { |
||
| 105 | |||
| 106 | |||
| 107 | /** |
||
| 108 | * @return string |
||
| 109 | */ |
||
| 110 | public function getLevelName() { |
||
| 113 | |||
| 114 | |||
| 115 | /** |
||
| 116 | * @return FileTool |
||
| 117 | */ |
||
| 118 | public function getTool() { |
||
| 121 | |||
| 122 | |||
| 123 | /** |
||
| 124 | * @return string |
||
| 125 | */ |
||
| 126 | public function getToolName() { |
||
| 129 | |||
| 130 | } |