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