Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
10 / 10 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
_RegexXData | |
100.00% |
10 / 10 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
getLocalXCodes | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
getXMessageTemplates | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * @package pvcRegex |
5 | * @author: Doug Wilbourne (dougwilbourne@gmail.com) |
6 | * @noinspection PhpCSValidationInspection |
7 | */ |
8 | |
9 | declare (strict_types=1); |
10 | |
11 | namespace pvc\regex\err; |
12 | |
13 | use pvc\err\XDataAbstract; |
14 | use pvc\interfaces\err\XDataInterface; |
15 | |
16 | /** |
17 | * Class _RegexXData |
18 | */ |
19 | class _RegexXData extends XDataAbstract implements XDataInterface |
20 | { |
21 | |
22 | public function getLocalXCodes(): array |
23 | { |
24 | return [ |
25 | RegexBadPatternException::class => 1001, |
26 | RegexInvalidDelimiterException::class => 1002, |
27 | RegexInvalidMatchIndexException::class => 1003, |
28 | ]; |
29 | } |
30 | |
31 | public function getXMessageTemplates(): array |
32 | { |
33 | return [ |
34 | RegexBadPatternException::class => 'Pattern ${badPattern} is not a valid regular expression.', |
35 | RegexInvalidDelimiterException::class => 'delimiter must be a single char, not alphanumeric, not whitespace and not a backslash.', |
36 | RegexInvalidMatchIndexException::class => 'match index ${badIndex}: no such index in the matches array.', |
37 | |
38 | ]; |
39 | } |
40 | } |