<?php
// Own namespace
-namespace CoreFramework\Filter\Validator\Email;
+namespace Org\Mxchange\CoreFramework\Filter\Validator\Email;
// Import framework stuff
-use CoreFramework\Filter\BaseFilter;
-use CoreFramework\Filter\Filterable;
-use CoreFramework\Registry\Registry;
-use CoreFramework\Request\Requestable;
-use CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Filter\BaseFilter;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
/**
* A concrete filter for validating the email address. This filter may intercept
// Is the email still not set?
if ((is_null($email1)) || (is_null($email2))) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(FALSE);
+ $requestInstance->requestIsValid(false);
// Add a message to the response
$responseInstance->addFatalMessage('email_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ((empty($email1)) || (empty($email2))) {
// Email is empty
- $requestInstance->requestIsValid(FALSE);
+ $requestInstance->requestIsValid(false);
// Is the email empty?
if (empty($email1)) {
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifEmailIsTaken($email1)) {
// Email is already taken
- $requestInstance->requestIsValid(FALSE);
+ $requestInstance->requestIsValid(false);
// Add a message to the response
$responseInstance->addFatalMessage('email_taken');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($email1 != $email2) {
// Emails didn't match
- $requestInstance->requestIsValid(FALSE);
+ $requestInstance->requestIsValid(false);
// Add a message to the response
$responseInstance->addFatalMessage('emails_mismatch');
} // END - elseif
} elseif (empty($email)) {
// Empty field!
- $requestInstance->requestIsValid(FALSE);
+ $requestInstance->requestIsValid(false);
// Add a message to the response
$responseInstance->addFatalMessage('email_empty');
*/
private function ifEmailIsTaken ($email) {
// Default is already taken
- $alreadyTaken = TRUE;
+ $alreadyTaken = true;
// Initialize instance
$userInstance = NULL;
// Get a registry instance
- $registry = Registry::getRegistry();
+ $registry = GenericRegistry::getRegistry();
// Is the user already there?
if ($registry->instanceExists('user')) {
}
// Does the email exist?
- if ($userInstance->ifEmailAddressExists() === FALSE) {
+ if ($userInstance->ifEmailAddressExists() === false) {
// This email has not being used yet
- $alreadyTaken = FALSE;
+ $alreadyTaken = false;
}
// Return the result