Total Complexity | 5 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | final class ValidationError |
||
10 | { |
||
11 | /** |
||
12 | * @var string Message describing why the password could not be validated. |
||
13 | */ |
||
14 | private $message; |
||
15 | |||
16 | /** |
||
17 | * @var Password|string $password Password that could not be validated. |
||
18 | */ |
||
19 | private $password; |
||
20 | |||
21 | /** |
||
22 | * @var RuleInterface Rule that the password is not in compliance with. |
||
23 | */ |
||
24 | private $rule; |
||
25 | |||
26 | /** |
||
27 | * @var int Weight of violated constraint. |
||
28 | */ |
||
29 | private $weight; |
||
30 | |||
31 | /** |
||
32 | * @param string $message Message describing why the password could not be validated. |
||
33 | * @param Password|string $password Password that could not be validated. |
||
34 | * @param RuleInterface $rule Rule that the password is not in compliance with. |
||
35 | * @param int $weight Weight of violated constraint. |
||
36 | */ |
||
37 | 1 | public function __construct(string $message, $password, RuleInterface $rule, int $weight) |
|
43 | 1 | } |
|
44 | |||
45 | /** |
||
46 | * @return string Message describing why the password could not be validated. |
||
47 | */ |
||
48 | 1 | public function getMessage(): string |
|
49 | { |
||
50 | 1 | return $this->message; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return Password|string $password Password that could not be validated. |
||
55 | */ |
||
56 | 1 | public function getPassword() |
|
57 | { |
||
58 | 1 | return $this->password; |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return RuleInterface Rule that the password is not in compliance with. |
||
63 | */ |
||
64 | 1 | public function getRule(): RuleInterface |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return int Weight of violated constraint. |
||
71 | */ |
||
72 | 1 | public function getWeight(): int |
|
75 | } |
||
76 | } |
||
77 |