validateProject($value, $this->context); foreach ($this->constraints as $innerConstraint) { $this->context ->getValidator() ->inContext($this->context) ->validate($value, $innerConstraint, [Constraint::DEFAULT_GROUP]); } } protected function validateProject(Project $project, ExecutionContextInterface $context): void { if (null !== $project->getStart() && null !== $project->getEnd() && $project->getStart()->getTimestamp() > $project->getEnd()->getTimestamp()) { $context->buildViolation(ProjectConstraint::getErrorName(ProjectConstraint::END_BEFORE_BEGIN_ERROR)) ->atPath('end') ->setTranslationDomain('validators') ->setCode(ProjectConstraint::END_BEFORE_BEGIN_ERROR) ->addViolation(); } } }