All filters rewritten to throw FilterChainException
[core.git] / inc / classes / main / filter / verifier / class_UserNameVerifierFilter.php
index 82d1eeb..32f0aa2 100644 (file)
@@ -53,6 +53,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
         * @param       $requestInstance        An instance of a class with an Requestable interface
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
         * @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 username from request
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get username from request
@@ -67,7 +68,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->addFatalMessage('username_unset');
 
                        // Abort here
                        $responseInstance->addFatalMessage('username_unset');
 
                        // Abort here
-                       return false;
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
                        $requestInstance->requestIsValid(false);
                } elseif (empty($userName)) {
                        // Empty field!
                        $requestInstance->requestIsValid(false);
@@ -76,7 +77,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->addFatalMessage('username_empty');
 
                        // Abort here
                        $responseInstance->addFatalMessage('username_empty');
 
                        // Abort here
-                       return false;
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($this->ifUserNameIsTaken($userName) === false) {
                        // Username is already taken
                        $requestInstance->requestIsValid(false);
                } elseif ($this->ifUserNameIsTaken($userName) === false) {
                        // Username is already taken
                        $requestInstance->requestIsValid(false);
@@ -85,7 +86,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->addFatalMessage('username_not_found');
 
                        // Abort here
                        $responseInstance->addFatalMessage('username_not_found');
 
                        // Abort here
-                       return false;
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                }
        }
 
                }
        }