Add specific exception class for overly short input strings
This commit is contained in:
parent
22cbd94f09
commit
15f2645514
25
exceptions/updates/MDInputStringTooShort.php
Normal file
25
exceptions/updates/MDInputStringTooShort.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* This file contains an exception class to use when an input string is too short.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file contains an exception class to use when an input string is too short.
|
||||||
|
*/
|
||||||
|
final class MDInputStringTooShort extends MDgenericInvalidInputsException {
|
||||||
|
/**
|
||||||
|
* Error message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage() {
|
||||||
|
//error message
|
||||||
|
return 'Input string is too short: ' . $this->getMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user