Throw a dedicated exception for fully empty actor descriptions in
NodaValidationHelper
This commit is contained in:
parent
c00cb6b629
commit
027d4b3506
@ -27,6 +27,13 @@ final class NodaValidationHelper {
|
||||
*/
|
||||
public static function validateActorDescription(string $description, array $names = []):void {
|
||||
|
||||
// For nodac, empty actor descriptions are to be allowed. Thus, a
|
||||
// dedicated check for fully empty ones with a dedicated exception
|
||||
// is needed.
|
||||
if (empty($description)) {
|
||||
throw new MDInvalidEmptyInputException("No author name is provided");
|
||||
}
|
||||
|
||||
// Throw error on descriptions that are too short
|
||||
if (\mb_strlen($description) < 10) {
|
||||
throw new MDgenericInvalidInputsException("Author description is too short");
|
||||
|
Loading…
Reference in New Issue
Block a user