Exemplo n.º 1
0
 public function validate($value, $valueIdentifier = null)
 {
     $this->value = $value;
     $maxValidator = new MinLength();
     if (isset($this->options['max'])) {
         $maxValidator->setOption('max', $this->options['max']);
     }
     $minValidator = new MaxLength();
     if (isset($this->options['min'])) {
         $minValidator->setOption('min', $this->options['min']);
     }
     $this->success = $minValidator->validate($value, $valueIdentifier) && $maxValidator->validate($value, $valueIdentifier);
     return $this->success;
 }