Move ModelValidator::validateNonRoleEmail() to a new Validator class
We want to remove/refactor the whole ModelValidator class as part of the Doctrine refactor. This commit moves the method ModelValidator::validateNonRoleEmail() to a new Validator class as the method is not used by the validator system of the Paris models. ModelValidator::validateEmail() was also moved as it is called by ModelValidator::validateNonRoleEmail(). [MAILPOET-4343]
This commit is contained in:
committed by
Aschepikov
parent
d760272678
commit
00d021109c
@@ -3,7 +3,7 @@
|
||||
namespace MailPoet\Form\Block;
|
||||
|
||||
use MailPoet\Form\Util\FieldNameObfuscator;
|
||||
use MailPoet\Models\ModelValidator;
|
||||
use MailPoet\Services\Validator;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
/**
|
||||
@@ -32,8 +32,8 @@ class BlockRendererHelper {
|
||||
|
||||
if ($blockId === 'email') {
|
||||
$rules['required'] = true;
|
||||
$rules['minlength'] = ModelValidator::EMAIL_MIN_LENGTH;
|
||||
$rules['maxlength'] = ModelValidator::EMAIL_MAX_LENGTH;
|
||||
$rules['minlength'] = Validator::EMAIL_MIN_LENGTH;
|
||||
$rules['maxlength'] = Validator::EMAIL_MAX_LENGTH;
|
||||
$rules['type-message'] = __('This value should be a valid email.', 'mailpoet');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user