Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
25 | public function parseLine($line) |
||
26 | { |
||
27 | if (!is_string($line)) { |
||
28 | throw new ParserException('Parser argument must be a string.'); |
||
29 | } |
||
30 | |||
31 | $match = @preg_match($this->getPattern(), $line, $matches); |
||
32 | |||
33 | if ($match === false) { |
||
34 | $error = error_get_last(); |
||
35 | throw new ParserException("Matcher failure. Please check if given format is valid. ({$error["message"]})"); |
||
36 | } |
||
37 | |||
38 | if (!$match) { |
||
39 | throw new NoMatchesException('Given line does not match predefined pattern.'); |
||
40 | } |
||
41 | |||
42 | return $this->prepareParsedData($matches); |
||
43 | } |
||
44 | } |
||
45 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.