X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fresolver%2Fcommand%2Fconsole%2Fclass_ConsoleCommandResolver.php;h=92840c2440c15af23427445deec7b49926015ecf;hp=17a29204ba334b9b5b74b9d9610a87a3bb418c20;hb=67f34799fe805b8a01cd56f64d12813a37195ee1;hpb=63f5632b0c5d2cebf8dd0940fdab561f86470f80 diff --git a/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php b/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php index 17a29204..92840c24 100644 --- a/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php +++ b/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php @@ -5,10 +5,12 @@ namespace CoreFramework\Resolver\Command; // Import framework stuff use CoreFramework\Command\BaseCommand; use CoreFramework\Command\InvalidCommandException; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Command\CommandResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A command resolver for local (non-hubbed) web commands * @@ -51,7 +53,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol * @param $commandName The default command we shall execute * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidArgumentException Thrown if default command is not set * @throws InvalidCommandException Thrown if default command is invalid */ public static final function createConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) { @@ -61,7 +63,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol // Is the variable $commandName set and the command is valid? if (empty($commandName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "commandName" is empty'); } elseif ($resolverInstance->isCommandValid($commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);