You are here

public function ValidationVisitor::visit in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/ValidationVisitor.php \Symfony\Component\Validator\ValidationVisitor::visit()

Validates a value against the constraints defined in some metadata.

This method implements the Visitor design pattern. See also {@link ValidationVisitorInterface}.

Parameters

MetadataInterface $metadata The metadata holding the constraints.:

mixed $value The value to validate.:

string $group The validation group to validate.:

string $propertyPath The current property path in the validation graph.:

Overrides ValidationVisitorInterface::visit

File

vendor/symfony/validator/ValidationVisitor.php, line 102

Class

ValidationVisitor
Default implementation of {@link ValidationVisitorInterface} and {@link GlobalExecutionContextInterface}.

Namespace

Symfony\Component\Validator

Code

public function visit(MetadataInterface $metadata, $value, $group, $propertyPath) {
  $context = new ExecutionContext($this, $this->translator, $this->translationDomain, $metadata, $value, $group, $propertyPath);
  $context
    ->validateValue($value, $metadata
    ->findConstraints($group));
}