OptionsInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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\Configuration;
  11. /**
  12. * Interface defining a container for client options.
  13. *
  14. * @property-read mixed aggregate Custom connection aggregator.
  15. * @property-read mixed cluster Aggregate connection for clustering.
  16. * @property-read mixed connections Connection factory.
  17. * @property-read mixed exceptions Toggles exceptions in client for -ERR responses.
  18. * @property-read mixed prefix Key prefixing strategy using the given prefix.
  19. * @property-read mixed profile Server profile.
  20. * @property-read mixed replication Aggregate connection for replication.
  21. *
  22. * @author Daniele Alessandri <suppakilla@gmail.com>
  23. */
  24. interface OptionsInterface
  25. {
  26. /**
  27. * Returns the default value for the given option.
  28. *
  29. * @param string $option Name of the option.
  30. *
  31. * @return mixed|null
  32. */
  33. public function getDefault($option);
  34. /**
  35. * Checks if the given option has been set by the user upon initialization.
  36. *
  37. * @param string $option Name of the option.
  38. *
  39. * @return bool
  40. */
  41. public function defined($option);
  42. /**
  43. * Checks if the given option has been set and does not evaluate to NULL.
  44. *
  45. * @param string $option Name of the option.
  46. *
  47. * @return bool
  48. */
  49. public function __isset($option);
  50. /**
  51. * Returns the value of the given option.
  52. *
  53. * @param string $option Name of the option.
  54. *
  55. * @return mixed|null
  56. */
  57. public function __get($option);
  58. }