ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssLacAbstractManufacturer.php
Go to the documentation of this file.
1<?php
2
3include_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Factory/ilAssLacManufacturerInterface.php";
4
13{
14
24 public function match($subject)
25 {
26 $matches = array();
27 $num_matches = preg_match_all($this->getPattern(), $subject, $matches);
28
29 if ($num_matches == 0) {
30 require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnableToParseCondition.php';
31 throw new ilAssLacUnableToParseCondition($subject);
32 }
33 // Trims each element in the matches array
34 $matches = array_map(function ($element) {
35 return trim($element);
36 }, $matches[0]);
37
38 return $matches;
39 }
40}
An exception for terminatinating execution or to throw for unit testing.
match($subject)
Matches a delivered string with a the pattern returned by getPattern implemented in the explicit Manu...