X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=framework%2Fmain%2Finterfaces%2Fresolver%2Fcommands%2Fclass_CommandResolver.php;h=73100caf868db804a56d5536150af72b7549a712;hb=b470fb8107e5029819c345f23a961fbd8085af7e;hp=b8d4b55a29428064fc04c71938378cad03321499;hpb=498d84788ad9a967218036ece9353959843b0966;p=core.git diff --git a/framework/main/interfaces/resolver/commands/class_CommandResolver.php b/framework/main/interfaces/resolver/commands/class_CommandResolver.php index b8d4b55a..73100caf 100644 --- a/framework/main/interfaces/resolver/commands/class_CommandResolver.php +++ b/framework/main/interfaces/resolver/commands/class_CommandResolver.php @@ -30,11 +30,31 @@ use Org\Mxchange\CoreFramework\Resolver\Resolver; */ interface CommandResolver extends Resolver { /** - * Returns an command instance for a given request class + * Getter for command name + * + * @return $commandName Last validated command name + */ + function getCommandName (); + + /** + * Returns an command instance for a given request class or null if + * it was not found * * @param $requestInstance An instance of a Requestable class * @return $commandInstance An instance of the resolved command + * @throws InvalidCommandException Thrown if $commandName is invalid + * @throws UnexpectedValueException Thrown if $commandInstance is an invalid instance */ function resolveCommandByRequest (Requestable $requestInstance); + /** + * Resolves the command by its direct name and returns an instance of its class + * + * @param $namespace Namespace to look in + * @param $commandName The direct command name we shall resolve + * @return $commandInstance An instance of the command class + * @throws InvalidCommandException Thrown if $commandName is invalid + */ + function resolveCommand (string $namespace, string $commandName); + }