/**
  * @param ObjectValue\MinimumPropertiesConstraint $constraint
  *
  * @return string
  */
 public function visitMinimumPropertiesConstraint(ObjectValue\MinimumPropertiesConstraint $constraint)
 {
     return sprintf('The object must not have less than %s properties.', var_export($constraint->minimum(), true));
 }
Пример #2
0
 /**
  * @param ObjectValue\MinimumPropertiesConstraint $constraint
  *
  * @return Result\ValidationResult
  */
 public function visitMinimumPropertiesConstraint(ObjectValue\MinimumPropertiesConstraint $constraint)
 {
     $value = $this->currentValue();
     if (!$value instanceof Value\ObjectValue || $value->count() >= $constraint->minimum()) {
         return $this->createResult();
     }
     return $this->createSingleIssueResult($constraint);
 }