Option.php 325 B

1234567891011121314151617
  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. return $this->validate(isset($value) ? $value : $this->getDefault());
  12. }
  13. }