Option.php 366 B

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