]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/resolver/web/class_WebCommandResolver.php
Logout procedure basicly finished, login area splitted in main and action-dependent...
[shipsimu.git] / inc / classes / main / resolver / web / class_WebCommandResolver.php
index f4b87a2b30c7967e36bc25d5fc7e15877e6834f9..ba0eb1563553ebd36c028a82c24a7c8d11930f3a 100644 (file)
@@ -77,7 +77,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
 
        /**
         * Returns an command instance for a given request class or null if
 
        /**
         * Returns an command instance for a given request class or null if
-        * MissingArrayElementsException was thrown
+        * it was not found
         *
         * @param       $requestInstance        An instance of a request class
         * @return      $commandInstance        An instance of the resolved command
         *
         * @param       $requestInstance        An instance of a request class
         * @return      $commandInstance        An instance of the resolved command
@@ -91,34 +91,29 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                $commandName = "";
                $commandInstance = null;
 
                $commandName = "";
                $commandInstance = null;
 
-               // Test if the required parameter is set
-               try {
-                       // This goes fine so let's resolv the command
-                       $commandName = $requestInstance->getRequestElement("page");
+               // This goes fine so let's resolv the command
+               $commandName = $requestInstance->getRequestElement("page");
 
 
-                       // Is the command empty? Then fall back to default command
-                       if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
 
 
-                       // Check if the command is valid
-                       if (!$this->isCommandValid($commandName)) {
-                               // This command is invalid!
-                               throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-                       }
+               // Check if the command is valid
+               if (!$this->isCommandValid($commandName)) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
 
 
-                       // Get the command
-                       $commandInstance = $this->loadCommand($commandName);
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
 
 
-                       // And validate it
-                       if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
-                               // This command has an invalid instance!
-                               throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-                       }
+               // And validate it
+               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+                       // This command has an invalid instance!
+                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
 
 
-                       // Set last command
-                       $this->lastCommandInstance = $commandInstance;
-               } catch (MissingArrayElementsException $e) {
-                       // Just catch it here...
-               }
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
 
                // Return the resolved command instance
                return $commandInstance;
 
                // Return the resolved command instance
                return $commandInstance;