Add two user-management-focused exceptions

This commit is contained in:
Joshua Ramon Enslin 2023-06-25 01:54:53 +02:00
parent ca19b3ed2f
commit a769e1ea35
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
2 changed files with 54 additions and 0 deletions

View 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();
}
}

View 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();
}
}