*/
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);
+
}