code: static public function validateIdentity(
          ExecutionContextInterface $context,
          IdentityInterface $identity,
          array $config = [],
          $pathPrefix = null
      ) {
          $violationList = $context->getValidator()->validate($identity, [new Identity($config)]);
  
          if (!empty($pathPrefix)) {
              $pathPrefix = rtrim($pathPrefix, '.') . '.';
          }
  
          /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
          foreach ($violationList as $violation) {
              $context
                  ->buildViolation($violation->getMessage())
                  ->atPath($pathPrefix . $violation->getPropertyPath())
                  ->addViolation();
          }
      }
docs: Validates the identity for the given context.
  
  @param ExecutionContextInterface $context
  @param IdentityInterface         $identity
  @param array                     $config
  @param string                    $pathPrefix