| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class ValidationError |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var RuleInterface Rule that could not be validated. |
||
| 13 | */ |
||
| 14 | private $rule; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int Weight of violated constraint. |
||
| 18 | */ |
||
| 19 | private $weight; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string Message describing why the rule could not be validated. |
||
| 23 | */ |
||
| 24 | private $message; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param RuleInterface $rule Rule that could not be validated. |
||
| 28 | * @param int $weight Weight of violated constraint. |
||
| 29 | * @param string $message Message describing why the rule could not be validated. |
||
| 30 | */ |
||
| 31 | 1 | public function __construct(RuleInterface $rule, int $weight, string $message) |
|
| 36 | 1 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return RuleInterface Rule that could not be validated. |
||
| 40 | */ |
||
| 41 | 1 | public function getRule(): RuleInterface |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return int Weight of violated constraint. |
||
| 48 | */ |
||
| 49 | 1 | public function getWeight(): int |
|
| 50 | { |
||
| 51 | 1 | return $this->weight; |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return string Message describing why the rule could not be validated. |
||
| 56 | */ |
||
| 57 | 1 | public function getMessage(): string |
|
| 60 | } |
||
| 61 | } |
||
| 62 |