X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Fcommand%2Fclass_BaseCommandResolver.php;h=01285e608756cac44aece6f42a81d716766c5703;hp=ac9c0cab7b84f4ab65ef533db45a27f93d7bbd7a;hb=66e68715d3d5a5e7fd5a3046471914ef3f9dd4b4;hpb=49f84a522f0ccac3b70728cd41011a0be0eed8cf diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php index ac9c0cab..01285e60 100644 --- a/inc/classes/main/resolver/command/class_BaseCommandResolver.php +++ b/inc/classes/main/resolver/command/class_BaseCommandResolver.php @@ -2,11 +2,11 @@ /** * A generic command resolver class * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software + * @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 + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,11 +22,6 @@ * along with this program. If not, see . */ class BaseCommandResolver extends BaseResolver { - /** - * Prefix for local, remote or other resolver - */ - private $commandPrefix = ''; - /** * Validated command name */ @@ -43,16 +38,6 @@ class BaseCommandResolver extends BaseResolver { parent::__construct($className); } - /** - * Setter for command prefix - * - * @param $commandPrefix Last validated commandPrefix - * @return void - */ - protected final function setCommandPrefix ($commandPrefix) { - $this->commandPrefix = $commandPrefix; - } - /** * Setter for command name * @@ -73,15 +58,15 @@ class BaseCommandResolver extends BaseResolver { } /** - * Checks wether the given command is valid + * Checks whether the given command is valid * * @param $commandName The default command we shall execute - * @return $isValid Wether the given command is valid + * @return $isValid Whether the given command is valid * @throws EmptyVariableException Thrown if given command is not set */ public function isCommandValid ($commandName) { // By default nothing shall be valid - $isValid = false; + $isValid = FALSE; // Is a command set? if (empty($commandName)) { @@ -90,7 +75,7 @@ class BaseCommandResolver extends BaseResolver { } // END - if // Create the full class name - $className = $this->commandPrefix . $this->convertToClassName($commandName) . 'Command'; + $className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command'; // Now, let us create the full name of the command class $this->setClassName($className); @@ -98,7 +83,7 @@ class BaseCommandResolver extends BaseResolver { // Is this class already loaded? if (class_exists($this->getClassName())) { // This class does exist. :-) - $isValid = true; + $isValid = TRUE; } // END - if // Set command name