/** * @param \Symfony\Component\Validator\Constraint $constraint */ protected function validate(Constraint $constraint) { $subPath = (string) $this->getCurrentPropertyPath(); if ($this->context instanceof LegacyExecutionContextInterface) { $this->context->validateValue($this->getValue(), $constraint, $subPath, $this->group); } else { $this->context->getValidator()->inContext($this->context)->atPath($subPath)->validate($this->getValue(), $constraint, array($this->group)); } }