Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | 1 | public function __construct(string $template, string $regexToMatch = null) |
|
13 | { |
||
14 | 1 | $message = sprintf( |
|
15 | 1 | 'The template, "%s", does not have the correct format.', $template |
|
16 | ); |
||
17 | |||
18 | 1 | if (null === $regexToMatch) { |
|
19 | 1 | $message .= ' Use "@Namespace/template.ext"'; |
|
20 | } else { |
||
21 | $message .= sprintf(' The format must match this regex: %s', $regexToMatch); |
||
22 | } |
||
23 | |||
24 | 1 | parent::__construct($message); |
|
25 | 1 | } |
|
27 |