/**
  * @param StringValue\MinimumLengthConstraint $constraint
  *
  * @return string
  */
 public function visitMinimumLengthConstraint(StringValue\MinimumLengthConstraint $constraint)
 {
     return sprintf('The string must not have less than %s characters.', var_export($constraint->minimum(), true));
 }
Exemplo n.º 2
0
 /**
  * @param StringValue\MinimumLengthConstraint $constraint
  *
  * @return Result\ValidationResult
  */
 public function visitMinimumLengthConstraint(StringValue\MinimumLengthConstraint $constraint)
 {
     $value = $this->currentValue();
     if (!$value instanceof Value\StringValue || mb_strlen($value->value(), 'UTF-8') >= $constraint->minimum()) {
         return $this->createResult();
     }
     return $this->createSingleIssueResult($constraint);
 }