]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/resolver/action/web/class_WebActionResolver.php
Made lower to upper case:
[core.git] / inc / classes / main / resolver / action / web / class_WebActionResolver.php
index 2118ba7701c2e9f6bba9d0548a959fffef74d9e3..528a3440d111a94d2ff2292541c8c65199a438d4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -25,7 +25,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
        /**
         * Last successfull resolved action
         */
-       private $lastActionInstance = '';
+       private $lastActionInstance = NULL;
 
        /**
         * Protected constructor
@@ -37,19 +37,19 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
                parent::__construct(__CLASS__);
 
                // Set prefix to "Web"
-               $this->setActionPrefix("Web");
+               $this->setClassPrefix('Web');
        }
 
        /**
         * Creates an instance of a Web action resolver with a given default action
         *
         * @param       $actionName                             The default action we shall execute
-        * @param       $appInstance                    An instance of a manageable application helper class
+        * @param       $applicationInstance    An instance of a manageable application helper class
         * @return      $resolverInstance               The prepared action resolver instance
         * @throws      EmptyVariableException  Thrown if default action is not set
         * @throws      InvalidActionException  Thrown if default action is invalid
         */
-       public final static function createWebActionResolver ($actionName, ManageableApplication $appInstance) {
+       public static final function createWebActionResolver ($actionName, ManageableApplication $applicationInstance) {
                // Create the new instance
                $resolverInstance = new WebActionResolver();
 
@@ -57,13 +57,13 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
                if (empty($actionName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isActionValid($actionName) === false) {
+               } elseif ($resolverInstance->isActionValid($actionName) === FALSE) {
                        // Invalid action found
                        throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
                }
 
                // Set the application instance
-               $resolverInstance->setApplicationInstance($appInstance);
+               $resolverInstance->setApplicationInstance($applicationInstance);
 
                // Return the prepared instance
                return $resolverInstance;
@@ -83,16 +83,18 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
        public function resolveActionByRequest (Requestable $requestInstance) {
                // Init variables
                $actionName = '';
-               $actionInstance = null;
+               $actionInstance = NULL;
 
                // This goes fine so let's resolve the action
                $actionName = $requestInstance->getRequestElement('action');
 
                // Is the action empty? Then fall back to default action
-               if (empty($actionName)) $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
+               if (empty($actionName)) {
+                       $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
+               } // END - if
 
                // Check if action is valid
-               if ($this->isActionValid($actionName) === false) {
+               if ($this->isActionValid($actionName) === FALSE) {
                        // This action is invalid!
                        throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
                } // END - if
@@ -107,7 +109,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
                } // END - if
 
                // Set last action
-               $this->lastActionInstance = $actionInstance;
+               $this->setResolvedInstance($actionInstance);
 
                // Return the resolved action instance
                return $actionInstance;
@@ -121,19 +123,21 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
         */
        public function resolveAction () {
                // Initiate the instance variable
-               $actionInstance = null;
+               $actionInstance = NULL;
 
                // Get action name
                $actionName = $this->getActionName();
 
                // Is the action empty? Then fall back to default action
-               if (empty($actionName)) $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
+               if (empty($actionName)) {
+                       $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
+               } // END - if
 
                // Check if action is valid
-               if ($this->isActionValid($actionName) === false) {
+               if ($this->isActionValid($actionName) === FALSE) {
                        // This action is invalid!
                        throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
-               }
+               } // END - if
 
                // Get the action
                $actionInstance = $this->loadAction();