* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
+ * @throws FilterChainException If this filter fails to operate
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get Email from request
$responseInstance->addFatalMessage('email_unset');
// Abort here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ((empty($email1)) || (empty($email2))) {
// Email is empty
$requestInstance->requestIsValid(false);
} // END - if
// Abort here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifEmailIsTaken($email1)) {
// Email is already taken
$requestInstance->requestIsValid(false);
$responseInstance->addFatalMessage('email_taken');
// Abort here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($email1 != $email2) {
// Emails didn't match
$requestInstance->requestIsValid(false);
$responseInstance->addFatalMessage('emails_mismatch');
// Abort here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - elseif
} elseif (empty($email)) {
// Empty field!
$responseInstance->addFatalMessage('email_empty');
// Abort here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - elseif
}