HumHub Documentation (unofficial)

MultipleValidationWithAnd
in package
implements EmailValidation

Table of Contents

Interfaces

EmailValidation

Constants

ALLOW_ALL_ERRORS  = 1
All of validations will be invoked even if one of them got failure.
STOP_ON_ERROR  = 0
If one of validations fails, the remaining validations will be skipped.

Properties

$error  : MultipleErrors|null
$mode  : int
$validations  : array<string|int, EmailValidation>
$warnings  : array<string|int, mixed>

Methods

__construct()  : mixed
getError()  : InvalidEmail|null
Returns the validation errors.
getWarnings()  : array<string|int, Warning>
Returns the validation warnings.
isValid()  : bool
Returns true if the given email is valid.
initErrorStorage()  : void
processError()  : void
shouldStop()  : bool

Constants

ALLOW_ALL_ERRORS

All of validations will be invoked even if one of them got failure.

public mixed ALLOW_ALL_ERRORS = 1

So MultipleErrors will contain all causes.

STOP_ON_ERROR

If one of validations fails, the remaining validations will be skipped.

public mixed STOP_ON_ERROR = 0

This means MultipleErrors will only contain a single error, the first found.

Properties

Methods

__construct()

public __construct(array<string|int, EmailValidation$validations[, int $mode = self::ALLOW_ALL_ERRORS ]) : mixed
Parameters
$validations : array<string|int, EmailValidation>

The validations.

$mode : int = self::ALLOW_ALL_ERRORS

The validation mode (one of the constants).

isValid()

Returns true if the given email is valid.

public isValid(string $email, EmailLexer $emailLexer) : bool
Parameters
$email : string

The email you want to validate.

$emailLexer : EmailLexer

The email lexer.

Return values
bool

        
On this page

Search results