public execute ( Disque\Command\CommandInterface $command ) | ||
$command | Disque\Command\CommandInterface |
public function execute(CommandInterface $command)
{
$this->shouldBeConnected();
$command = $this->preprocessExecution($command);
$response = $this->getCurrentNode()->execute($command);
$response = $this->postprocessExecution($command, $response);
return $response;
}
/** * @throws InvalidCommandException */ public function __call($command, array $arguments) { $command = strtoupper($command); if (!isset($this->commandHandlers[$command])) { throw new InvalidCommandException($command); } $command = $this->commandHandlers[$command]; $command->setArguments($arguments); $result = $this->connectionManager->execute($command); return $command->parse($result); }