Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ConstraintParameterException | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getViolationMessage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Helper; |
4 | |
5 | use Exception; |
6 | use WikibaseQuality\ConstraintReport\ConstraintCheck\Message\ViolationMessage; |
7 | |
8 | /** |
9 | * Exception thrown when a constraint’s parameters are invalid. |
10 | * |
11 | * @author Lucas Werkmeister |
12 | * @license GPL-2.0-or-later |
13 | */ |
14 | class ConstraintParameterException extends Exception { |
15 | |
16 | /** |
17 | * @var ViolationMessage |
18 | */ |
19 | private $violationMessage; |
20 | |
21 | /** |
22 | * @param ViolationMessage $violationMessage |
23 | */ |
24 | public function __construct( ViolationMessage $violationMessage ) { |
25 | $message = '⧼' . $violationMessage->getMessageKey() . '⧽'; |
26 | parent::__construct( $message ); |
27 | |
28 | $this->violationMessage = $violationMessage; |
29 | } |
30 | |
31 | /** |
32 | * @return ViolationMessage |
33 | */ |
34 | public function getViolationMessage() { |
35 | return $this->violationMessage; |
36 | } |
37 | |
38 | } |