You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a first approach, use the Strategy pattern so upon construction EmailValidator requires the strategies objects to be used for validation.
Strategies will be evaluated in an AND fashion. E.g
//$result has been setted after the first validationforeach ($this->strategiesas$strategy) {
$result = $result && $strategy->isValid($email, $this->lexer, $this->getWarnings());
}
Right now $this->lexer is mutable, probably needs to be immutable so there's no riks while passing it around.
Should also define ValidationStretegy::isValid interface.
RFCs validation would be the only one "hardcoded" within the validator. Probably being added in the constructor.
As a first approach, use the Strategy pattern so upon construction EmailValidator requires the strategies objects to be used for validation.
Strategies will be evaluated in an AND fashion. E.g
Right now
$this->lexer
is mutable, probably needs to be immutable so there's no riks while passing it around.Should also define
ValidationStretegy::isValid
interface.RFCs validation would be the only one "hardcoded" within the validator. Probably being added in the constructor.
EmailValidator::__construct(ValidationStrategies $stretegies)
The text was updated successfully, but these errors were encountered: