private function isRequiredByGroups(ValidatorPropertyMetadataInterface $validatorPropertyMetadata, array $options): bool
    {
        foreach ($options['validation_groups'] as $validationGroup) {
            if (!\is_string($validationGroup)) {
                continue;
            }

            foreach ($validatorPropertyMetadata->findConstraints($validationGroup) as $constraint) {
                if ($this->isRequired($constraint)) {
                    return true;
                }
            }
        }

        return false;
    }