/**
  * @param DateTimeValue\MinimumDateTimeConstraint $constraint
  *
  * @return string
  */
 public function visitMinimumDateTimeConstraint(DateTimeValue\MinimumDateTimeConstraint $constraint)
 {
     return sprintf('The date-time value must not be before %s.', var_export($constraint->minimum()->format('c'), true));
 }
예제 #2
0
 /**
  * @param DateTimeValue\MinimumDateTimeConstraint $constraint
  *
  * @return Result\ValidationResult
  */
 public function visitMinimumDateTimeConstraint(DateTimeValue\MinimumDateTimeConstraint $constraint)
 {
     $value = $this->currentValue();
     if (!$value instanceof Value\DateTimeValue || $value->value() >= $constraint->minimum()) {
         return $this->createResult();
     }
     return $this->createSingleIssueResult($constraint);
 }