src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php
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;
    }
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;
    }
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 ; }
Tests if the property is required because of its validation groups.
Tests if the property is required because of its validation groups .