All filters rewritten to throw FilterChainException
[core.git] / inc / classes / main / filter / verifier / class_UserGuestVerifierFilter.php
index 51c2e6f..b6ad60b 100644 (file)
@@ -53,6 +53,7 @@ class UserGuestVerifierFilter 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
+        * @throws      FilterChainException    If this filter fails to operate
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get username from request
@@ -67,7 +68,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->addFatalMessage('username_guest_unset');
 
                        // Abort here
-                       return false;
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
                        $requestInstance->requestIsValid(false);
@@ -76,7 +77,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->addFatalMessage('username_guest_empty');
 
                        // Abort here
-                       return false;
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($this->ifUserGuestIsTaken($userName) === false) {
                        // Username is already taken
                        $requestInstance->requestIsValid(false);
@@ -85,7 +86,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->addFatalMessage('username_guest_not_found');
 
                        // Abort here
-                       return false;
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                }
 
                // Set the element for compatiblity reasons