1 | <?php |
||
10 | class MarkupValidatorMessage implements MarkupValidatorMessageInterface |
||
11 | { |
||
12 | /** |
||
13 | * Message type. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $type; |
||
18 | |||
19 | /** |
||
20 | * Message summary. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $summary; |
||
25 | |||
26 | /** |
||
27 | * Message details. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $details; |
||
32 | |||
33 | /** |
||
34 | * A number of the first related markup line. |
||
35 | * |
||
36 | * @var integer |
||
37 | */ |
||
38 | protected $firstLineNumber; |
||
39 | |||
40 | /** |
||
41 | * A number of the last related markup line. |
||
42 | * |
||
43 | * @var integer |
||
44 | */ |
||
45 | protected $lastLineNumber; |
||
46 | |||
47 | /** |
||
48 | * Related markup. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $markup; |
||
53 | |||
54 | /** |
||
55 | * Constructs a new message. Sets message type. |
||
56 | * |
||
57 | * @param string $type Message type. |
||
58 | */ |
||
59 | public function __construct($type = self::TYPE_UNDEFINED) |
||
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | public function __toString() |
||
76 | |||
77 | /** |
||
78 | * Sets message type. |
||
79 | * |
||
80 | * @param string $type Message type. |
||
81 | * |
||
82 | * @return self Returns self. |
||
83 | */ |
||
84 | public function setType($type) |
||
94 | |||
95 | /** |
||
96 | * {@inheritDoc} |
||
97 | */ |
||
98 | public function getType() |
||
102 | |||
103 | /** |
||
104 | * Sets message summary. |
||
105 | * |
||
106 | * @param string $summary Message summary. |
||
107 | * |
||
108 | * @return self Returns self. |
||
109 | */ |
||
110 | public function setSummary($summary) |
||
116 | |||
117 | /** |
||
118 | * {@inheritDoc} |
||
119 | */ |
||
120 | public function getSummary() |
||
124 | |||
125 | /** |
||
126 | * Sets message details. |
||
127 | * |
||
128 | * @param string $details Message details. |
||
129 | * |
||
130 | * @return self Returns self. |
||
131 | */ |
||
132 | public function setDetails($details) |
||
138 | |||
139 | /** |
||
140 | * {@inheritDoc} |
||
141 | */ |
||
142 | public function getDetails() |
||
146 | |||
147 | /** |
||
148 | * Sets first line number. |
||
149 | * |
||
150 | * @param string $firstLineNumber First line number. |
||
151 | * |
||
152 | * @return self Returns self. |
||
153 | */ |
||
154 | public function setFirstLineNumber($firstLineNumber) |
||
160 | |||
161 | /** |
||
162 | * {@inheritDoc} |
||
163 | */ |
||
164 | public function getFirstLineNumber() |
||
168 | |||
169 | /** |
||
170 | * Sets last line number. |
||
171 | * |
||
172 | * @param string $lastLineNumber Last line number. |
||
173 | * |
||
174 | * @return self Returns self. |
||
175 | */ |
||
176 | public function setLastLineNumber($lastLineNumber) |
||
182 | |||
183 | /** |
||
184 | * {@inheritDoc} |
||
185 | */ |
||
186 | public function getLastLineNumber() |
||
190 | |||
191 | /** |
||
192 | * Sets markup. |
||
193 | * |
||
194 | * @param string $markup Markup. |
||
195 | * |
||
196 | * @return self Returns self. |
||
197 | */ |
||
198 | public function setMarkup($markup) |
||
204 | |||
205 | /** |
||
206 | * {@inheritDoc} |
||
207 | */ |
||
208 | public function getMarkup() |
||
212 | |||
213 | /** |
||
214 | * Returns string representation template. |
||
215 | * |
||
216 | * @return string String representation template. |
||
217 | */ |
||
218 | protected function getStringTemplate() |
||
231 | } |
||
232 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.