OptionsInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. * Defines an options container class.
  13. *
  14. * @author Daniele Alessandri <suppakilla@gmail.com>
  15. */
  16. interface OptionsInterface
  17. {
  18. /**
  19. * Returns the default value for the given option.
  20. *
  21. * @param string $option Name of the option.
  22. * @return mixed
  23. */
  24. public function getDefault($option);
  25. /**
  26. * Checks if the given option has been set by the user upon initialization.
  27. *
  28. * @param string $option Name of the option.
  29. * @return bool
  30. */
  31. public function defined($option);
  32. /**
  33. * Checks if the given option has been set and does not evaluate to NULL.
  34. *
  35. * @param string $option Name of the option.
  36. * @return bool
  37. */
  38. public function __isset($option);
  39. /**
  40. * Returns the value of the given option.
  41. *
  42. * @param string $option Name of the option.
  43. * @return mixed
  44. */
  45. public function __get($option);
  46. }