Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | 5 | public function __construct($variableName, $variableValue, $pattern) |
|
19 | { |
||
20 | 5 | if (!is_string($variableName)) { |
|
21 | 1 | throw new InvalidStringException('variableName', $variableName); |
|
22 | 4 | } elseif (!is_string($variableValue)) { |
|
23 | 1 | throw new InvalidStringException('variableValue', $variableValue); |
|
24 | 4 | } elseif (!is_string($pattern)) { |
|
25 | 1 | throw new InvalidStringException('pattern', $pattern); |
|
26 | } |
||
27 | |||
28 | 4 | parent::__construct( |
|
29 | 4 | sprintf( |
|
30 | 4 | 'Variable "$%s" must match RegExp pattern "%s", actual value: "%s"', |
|
31 | 4 | $variableName, |
|
32 | 4 | $pattern, |
|
33 | $variableValue |
||
34 | 4 | ) |
|
35 | 4 | ); |
|
36 | } |
||
37 | } |