/**
  * @param NumberValue\MinimumConstraint $constraint
  *
  * @return string
  */
 public function visitMinimumConstraint(NumberValue\MinimumConstraint $constraint)
 {
     return sprintf('The number must not be less than %s.', var_export($constraint->minimum(), true));
 }
Esempio n. 2
0
 /**
  * @param NumberValue\MinimumConstraint $constraint
  *
  * @return Result\ValidationResult
  */
 public function visitMinimumConstraint(NumberValue\MinimumConstraint $constraint)
 {
     $value = $this->currentValue();
     if (!$value instanceof Value\NumberValueInterface || $value->value() >= $constraint->minimum()) {
         return $this->createResult();
     }
     return $this->createSingleIssueResult($constraint);
 }