/**
* Creates an instance of a Web command resolver with a given default command
*
- * @param $defaultCommand The default command we shall execute
+ * @param $commandName The default command we shall execute
* @param $appInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared command resolver instance
* @throws EmptyVariableException Thrown if the default command is not set
* @throws InvalidCommandException Thrown if the default command is invalid
*/
- public final static function createWebCommandResolver ($defaultCommand, ManageableApplication $appInstance) {
+ public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
// Create the new instance
$resolverInstance = new WebCommandResolver();
- // Is the variable $defaultCommand set and the command is valid?
- if (empty($defaultCommand)) {
+ // Is the variable $commandName set and the command is valid?
+ if (empty($commandName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'defaultCommand'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif (!$resolverInstance->isCommandValid($defaultCommand)) {
+ } elseif (!$resolverInstance->isCommandValid($commandName)) {
// Invalid command found
- throw new InvalidCommandException(array($resolverInstance, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+ throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
// Set the application instance
// Create command class name
$class = sprintf("Web%sCommand",
- ucfirst(strtolower($commandName))
+ $this->convertToClassName($commandName)
);
// Is this class loaded?