public function validate($value, $valueIdentifier = null) { $this->value = $value; $minValidator = new LessThan(); if (isset($this->options['max'])) { $minValidator->setOption('max', $this->options['max']); } $maxValidator = new GreaterThan(); if (isset($this->options['min'])) { $maxValidator->setOption('min', $this->options['min']); } $this->success = $minValidator->validate($value, $valueIdentifier) && $maxValidator->validate($value, $valueIdentifier); return $this->success; }
/** * @inheritdoc */ public function matches($data) { $gt = new LessThan($this->value); $e = new Equal($this->value); return $gt->matches($data) || $e->matches($data); }