/**
  * @param ObjectValue\RequiredConstraint $constraint
  *
  * @return string
  */
 public function visitRequiredConstraint(ObjectValue\RequiredConstraint $constraint)
 {
     return sprintf('The property %s is required.', var_export($constraint->property(), true));
 }
Пример #2
0
 /**
  * @param ObjectValue\RequiredConstraint $constraint
  *
  * @return Result\ValidationResult
  */
 public function visitRequiredConstraint(ObjectValue\RequiredConstraint $constraint)
 {
     $value = $this->currentValue();
     if (!$value instanceof Value\ObjectValue || $value->has($constraint->property())) {
         return $this->createResult();
     }
     return $this->createSingleIssueResult($constraint);
 }