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