Add two user-management-focused exceptions
This commit is contained in:
parent
ca19b3ed2f
commit
a769e1ea35
27
exceptions/updates/MDInsufficientPassword.php
Normal file
27
exceptions/updates/MDInsufficientPassword.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* This file contains an exception class to be thrown if users try to set
|
||||||
|
* insufficient / too weak passwords.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file contains an exception class to be thrown if users try to set
|
||||||
|
* insufficient / too weak passwords.
|
||||||
|
*/
|
||||||
|
final class MDInsufficientPassword extends MDgenericInvalidInputsException {
|
||||||
|
/**
|
||||||
|
* Error message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage() {
|
||||||
|
//error message
|
||||||
|
return 'Insufficient / weak password: ' . $this->getMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
27
exceptions/updates/MDUserPasswordsDoNotMatch.php
Normal file
27
exceptions/updates/MDUserPasswordsDoNotMatch.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* This file contains an exception class to be raised if users' password and
|
||||||
|
* password verification don't match.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom exception class to be raised if users' password and password
|
||||||
|
* verification don't match.
|
||||||
|
*/
|
||||||
|
final class MDUserPasswordsDoNotMatch extends MDgenericInvalidInputsException {
|
||||||
|
/**
|
||||||
|
* Error message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage() {
|
||||||
|
//error message
|
||||||
|
return 'Passwords don\'t match: ' . $this->getMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user