CommandInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis\Command;
  11. /**
  12. * Defines an abstraction representing a Redis command.
  13. * @author Daniele Alessandri <suppakilla@gmail.com>
  14. */
  15. interface CommandInterface
  16. {
  17. /**
  18. * Gets the ID of a Redis command.
  19. *
  20. * @return string
  21. */
  22. public function getId();
  23. /**
  24. * Set the hash for the command.
  25. *
  26. * @param int $hash Calculated hash.
  27. */
  28. public function setHash($hash);
  29. /**
  30. * Returns the hash of the command.
  31. *
  32. * @return int
  33. */
  34. public function getHash();
  35. /**
  36. * Sets the arguments of the command.
  37. *
  38. * @param array $arguments List of arguments.
  39. */
  40. public function setArguments(Array $arguments);
  41. /**
  42. * Gets the arguments of the command.
  43. *
  44. * @return array
  45. */
  46. public function getArguments();
  47. /**
  48. * Parses a reply buffer and returns a PHP object.
  49. *
  50. * @param string $data Binary string containing the whole reply.
  51. * @return mixed
  52. */
  53. public function parseResponse($data);
  54. }