@@ 169-189 (lines=21) @@ | ||
166 | * |
|
167 | * @param string $startMultiLine the regexp that will match the starting block directives |
|
168 | */ |
|
169 | public function setStartMultiLine($startMultiLine) |
|
170 | { |
|
171 | if (!$this->checker->setString($startMultiLine)->getString()) { |
|
172 | throw ServerException::forInvalidMatcher( |
|
173 | $startMultiLine, |
|
174 | 'The starting block directive matcher is expected to be a string. Got: %s' |
|
175 | ); |
|
176 | } |
|
177 | ||
178 | if (!$this->checker->hasKeyAndValueSubPattern()) { |
|
179 | throw ServerException::forInvalidMatcher( |
|
180 | $startMultiLine, |
|
181 | 'The starting block directive matcher is expected to be a regexp '. |
|
182 | 'containing named subpatterns "key" and "value". Got: %s' |
|
183 | ); |
|
184 | } |
|
185 | ||
186 | $this->startMultiLine = $startMultiLine; |
|
187 | ||
188 | return $this; |
|
189 | } |
|
190 | ||
191 | /** |
|
192 | * Gets the regexp that will match the ending block directives. |
|
@@ 206-225 (lines=20) @@ | ||
203 | * |
|
204 | * @param string $endMultiLine the regexp that will match the ending block directives |
|
205 | */ |
|
206 | public function setEndMultiLine($endMultiLine) |
|
207 | { |
|
208 | if (!$this->checker->setString($endMultiLine)->getString()) { |
|
209 | throw ServerException::forInvalidMatcher( |
|
210 | $endMultiLine, |
|
211 | 'The ending block directive matcher is expected to be a string. Got: %s' |
|
212 | ); |
|
213 | } |
|
214 | ||
215 | if (!$this->checker->isValidRegex()) { |
|
216 | throw ServerException::forInvalidMatcher( |
|
217 | $endMultiLine, |
|
218 | 'The ending block directive matcher is expected to be a regexp.' |
|
219 | ); |
|
220 | } |
|
221 | ||
222 | $this->endMultiLine = $endMultiLine; |
|
223 | ||
224 | return $this; |
|
225 | } |
|
226 | ||
227 | /** |
|
228 | * Gets the regexp that will match the simple directives. |
|
@@ 242-262 (lines=21) @@ | ||
239 | * |
|
240 | * @param string $simpleDirective the regexp that will match the simple directives |
|
241 | */ |
|
242 | public function setSimpleDirective($simpleDirective) |
|
243 | { |
|
244 | if (!$this->checker->setString($simpleDirective)->getString()) { |
|
245 | throw ServerException::forInvalidMatcher( |
|
246 | $simpleDirective, |
|
247 | 'The simple directive matcher is expected to be a string. Got: %s' |
|
248 | ); |
|
249 | } |
|
250 | ||
251 | if (!$this->checker->hasKeyAndValueSubPattern()) { |
|
252 | throw ServerException::forInvalidMatcher( |
|
253 | $simpleDirective, |
|
254 | 'The simple directive matcher is expected to be a regexp '. |
|
255 | 'containing named subpatterns "key" and "value". Got: %s' |
|
256 | ); |
|
257 | } |
|
258 | ||
259 | $this->simpleDirective = $simpleDirective; |
|
260 | ||
261 | return $this; |
|
262 | } |
|
263 | ||
264 | /** |
|
265 | * Gets the list of binaries that can be run to analyze. |