1 | <?php |
||
10 | class MarkupValidatorMessage implements MarkupValidatorMessageInterface |
||
11 | { |
||
12 | /** |
||
13 | * Placeholder for unavailable message data. |
||
14 | */ |
||
15 | const UNAVAILABLE_DATA_PLACEHOLDER = 'unavailable'; |
||
16 | |||
17 | /** |
||
18 | * Message type. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $type; |
||
23 | |||
24 | /** |
||
25 | * Message summary. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $summary; |
||
30 | |||
31 | /** |
||
32 | * Message details. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $details; |
||
37 | |||
38 | /** |
||
39 | * A number of the first related markup line. |
||
40 | * |
||
41 | * @var integer |
||
42 | */ |
||
43 | protected $firstLineNumber; |
||
44 | |||
45 | /** |
||
46 | * A number of the last related markup line. |
||
47 | * |
||
48 | * @var integer |
||
49 | */ |
||
50 | protected $lastLineNumber; |
||
51 | |||
52 | /** |
||
53 | * Related markup. |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $markup; |
||
58 | |||
59 | /** |
||
60 | * Constructs a new message. Sets message type. |
||
61 | * |
||
62 | * @param string $type Message type. |
||
63 | */ |
||
64 | public function __construct($type = self::TYPE_UNDEFINED) |
||
68 | |||
69 | /** |
||
70 | * {@inheritDoc} |
||
71 | */ |
||
72 | public function __toString() |
||
83 | |||
84 | /** |
||
85 | * Sets message type. |
||
86 | * |
||
87 | * @param string $type Message type. |
||
88 | * |
||
89 | * @return self Returns self. |
||
90 | */ |
||
91 | public function setType($type) |
||
101 | |||
102 | /** |
||
103 | * {@inheritDoc} |
||
104 | */ |
||
105 | public function getType() |
||
109 | |||
110 | /** |
||
111 | * Sets message summary. |
||
112 | * |
||
113 | * @param string $summary Message summary. |
||
114 | * |
||
115 | * @return self Returns self. |
||
116 | */ |
||
117 | public function setSummary($summary) |
||
123 | |||
124 | /** |
||
125 | * {@inheritDoc} |
||
126 | */ |
||
127 | public function getSummary() |
||
131 | |||
132 | /** |
||
133 | * Sets message details. |
||
134 | * |
||
135 | * @param string $details Message details. |
||
136 | * |
||
137 | * @return self Returns self. |
||
138 | */ |
||
139 | public function setDetails($details) |
||
145 | |||
146 | /** |
||
147 | * {@inheritDoc} |
||
148 | */ |
||
149 | public function getDetails() |
||
153 | |||
154 | /** |
||
155 | * Sets first line number. |
||
156 | * |
||
157 | * @param integer $firstLineNumber First line number. |
||
158 | * |
||
159 | * @return self Returns self. |
||
160 | */ |
||
161 | public function setFirstLineNumber($firstLineNumber) |
||
167 | |||
168 | /** |
||
169 | * {@inheritDoc} |
||
170 | */ |
||
171 | public function getFirstLineNumber() |
||
175 | |||
176 | /** |
||
177 | * Sets last line number. |
||
178 | * |
||
179 | * @param integer $lastLineNumber Last line number. |
||
180 | * |
||
181 | * @return self Returns self. |
||
182 | */ |
||
183 | public function setLastLineNumber($lastLineNumber) |
||
189 | |||
190 | /** |
||
191 | * {@inheritDoc} |
||
192 | */ |
||
193 | public function getLastLineNumber() |
||
197 | |||
198 | /** |
||
199 | * Sets markup. |
||
200 | * |
||
201 | * @param string $markup Markup. |
||
202 | * |
||
203 | * @return self Returns self. |
||
204 | */ |
||
205 | public function setMarkup($markup) |
||
211 | |||
212 | /** |
||
213 | * {@inheritDoc} |
||
214 | */ |
||
215 | public function getMarkup() |
||
219 | |||
220 | /** |
||
221 | * Returns string representation template. |
||
222 | * |
||
223 | * @return string String representation template. |
||
224 | */ |
||
225 | protected function getStringTemplate() |
||
240 | } |
||
241 |