Moved some class fields and their setter/getter to BaseFrameworkSystem.
authorRoland Haeder <roland@mxchange.org>
Sun, 5 Apr 2015 21:38:05 +0000 (23:38 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 5 Apr 2015 21:38:05 +0000 (23:38 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/commands/class_BaseCommand.php
inc/classes/main/resolver/command/class_BaseCommandResolver.php
inc/classes/main/resolver/controller/class_BaseControllerResolver.php

index a294e8e..a542b37 100644 (file)
@@ -243,6 +243,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $genericArray = array();
 
+       /**
+        * Command name
+        */
+       private $commandName = '';
+
+       /**
+        * Controller name
+        */
+       private $controllerName = '';
+
        /***********************
         * Exception codes.... *
         ***********************/
@@ -1433,6 +1443,44 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->listenerInstance;
        }
 
+       /**
+        * Setter for command name
+        *
+        * @param       $commandName    Last validated command name
+        * @return      void
+        */
+       protected final function setCommandName ($commandName) {
+               $this->commandName = $commandName;
+       }
+
+       /**
+        * Getter for command name
+        *
+        * @return      $commandName    Last validated command name
+        */
+       protected final function getCommandName () {
+               return $this->commandName;
+       }
+
+       /**
+        * Setter for controller name
+        *
+        * @param       $controllerName Last validated controller name
+        * @return      void
+        */
+       protected final function setControllerName ($controllerName) {
+               $this->controllerName = $controllerName;
+       }
+
+       /**
+        * Getter for controller name
+        *
+        * @return      $controllerName Last validated controller name
+        */
+       protected final function getControllerName () {
+               return $this->controllerName;
+       }
+
        /**
         * Checks whether an object equals this object. You should overwrite this
         * method to implement own equality checks
index 05fd5ce..efb9d16 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseCommand extends BaseFrameworkSystem {
-       /**
-        * The controller we need for this command
-        */
-       private $controllerName = '';
-
        /**
         * Protected constructor
         *
@@ -37,25 +32,6 @@ class BaseCommand extends BaseFrameworkSystem {
                // Call parent constructor
                parent::__construct($className);
        }
-
-       /**
-        * Setter for controller name
-        *
-        * @param       $controllerName         Name of the controller assigned with this command
-        * @return      void
-        */
-       public final function setControllerName ($controllerName) {
-               $this->controllerName = (string) $controllerName;
-       }
-
-       /**
-        * Getter for controller name
-        *
-        * @return      $controllerName         Name of the controller assigned with this command
-        */
-       public final function getControllerName () {
-               return $this->controllerName;
-       }
 }
 
 // [EOF]
index 0994bf1..283f555 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseCommandResolver extends BaseResolver {
-       /**
-        * Validated command name
-        */
-       private $commandName = '';
-
        /**
         * Protected constructor
         *
@@ -38,25 +33,6 @@ class BaseCommandResolver extends BaseResolver {
                parent::__construct($className);
        }
 
-       /**
-        * Setter for command name
-        *
-        * @param       $commandName    Last validated command name
-        * @return      void
-        */
-       protected final function setCommandName ($commandName) {
-               $this->commandName = $commandName;
-       }
-
-       /**
-        * Getter for command name
-        *
-        * @return      $commandName    Last validated command name
-        */
-       protected final function getCommandName () {
-               return $this->commandName;
-       }
-
        /**
         * "Loads" a given command and instances it if not yet cached
         *
index 0356054..14db8c3 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseControllerResolver extends BaseResolver {
-       /**
-        * Validated controller name
-        */
-       private $controllerName = '';
-
        /**
         * Protected constructor
         *
@@ -38,25 +33,6 @@ class BaseControllerResolver extends BaseResolver {
                parent::__construct($className);
        }
 
-       /**
-        * Setter for controller name
-        *
-        * @param       $controllerName         Last validated controller name
-        * @return      void
-        */
-       protected final function setControllerName ($controllerName) {
-               $this->controllerName = $controllerName;
-       }
-
-       /**
-        * Getter for controller name
-        *
-        * @return      $controllerName Last validated controller name
-        */
-       public final function getControllerName () {
-               return $this->controllerName;
-       }
-
        /**
         * "Loads" a given controller and instances it if not yet cached. If the
         * controller was not found one of the default controllers will be used