Option.php 379 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Predis\Options;
  3. class Option implements IOption
  4. {
  5. public function validate($value)
  6. {
  7. return $value;
  8. }
  9. public function getDefault()
  10. {
  11. return null;
  12. }
  13. public function __invoke($value)
  14. {
  15. if (isset($value)) {
  16. return $this->validate($value);
  17. }
  18. return $this->getDefault();
  19. }
  20. }