@@ 205-224 (lines=20) @@ | ||
202 | * |
|
203 | * @param string $endMultiLine the regexp that will match the ending block directives |
|
204 | */ |
|
205 | public function setEndMultiLine($endMultiLine) |
|
206 | { |
|
207 | if (!$this->checker->setString($endMultiLine)->getString()) { |
|
208 | throw ServerException::forInvalidMatcher( |
|
209 | $endMultiLine, |
|
210 | 'The ending block directive matcher is expected to be a string. Got: %s' |
|
211 | ); |
|
212 | } |
|
213 | ||
214 | if (!$this->checker->isValidRegex()) { |
|
215 | throw ServerException::forInvalidMatcher( |
|
216 | $endMultiLine, |
|
217 | 'The ending block directive matcher is expected to be a regexp.' |
|
218 | ); |
|
219 | } |
|
220 | ||
221 | $this->endMultiLine = $endMultiLine; |
|
222 | ||
223 | return $this; |
|
224 | } |
|
225 | ||
226 | /** |
|
227 | * Gets the regexp that will match the simple directives. |
|
@@ 270-289 (lines=20) @@ | ||
267 | * |
|
268 | * @param string $simpleDirective the regexp that will match the inclusion directives |
|
269 | */ |
|
270 | public function setInclusionDirective($inclusionDirective) |
|
271 | { |
|
272 | if (!$this->checker->setString($inclusionDirective)->getString()) { |
|
273 | throw ServerException::forInvalidMatcher( |
|
274 | $inclusionDirective, |
|
275 | 'The inclusion directive matcher is expected to be a string. Got: %s' |
|
276 | ); |
|
277 | } |
|
278 | ||
279 | if (!$this->checker->isValidRegex()) { |
|
280 | throw ServerException::forInvalidMatcher( |
|
281 | $inclusionDirective, |
|
282 | 'The inclusion directive matcher is expected to be a regexp.' |
|
283 | ); |
|
284 | } |
|
285 | ||
286 | $this->inclusionDirective = $inclusionDirective; |
|
287 | ||
288 | return $this; |
|
289 | } |
|
290 | ||
291 | /** |
|
292 | * Confirms if a directive matcher is a valid regex. |