Ejemplo n.º 1
0
 protected function validate()
 {
     $this->_email = $this->email->orThrow(ValidatorException::class, "You must specify your email")->filter(Filter::matchRegExp(VALIDATOR_EMAIL_TEMPLATE))->getOrThrow(ValidatorException::class, "You must specify correct email");
     $this->_password = $this->password->orThrow(ValidatorException::class, "You must specify your password")->filter(Filter::lengthInRange(VALIDATOR_PWD_MIN_LENGTH, VALIDATOR_PWD_MAX_LENGTH))->getOrThrow(ValidatorException::class, sprintf("Password must be in range from %d to %d chars", VALIDATOR_PWD_MIN_LENGTH, VALIDATOR_PWD_MAX_LENGTH));
 }