Validator/Constraints/SharingValidator.php
private function validateRoles(
        Sharing $constraint,
        SharingIdentityConfigInterface $config,
        array $roles
    ): void {
        if (!empty($roles) && !$config->isPermissible()) {
            $this->context->buildViolation($constraint->identityNotRoleableMessage)
                ->atPath($constraint->roles)
                ->setParameter('%class_property%', $constraint->identityClass)
                ->setParameter('%class%', $config->getType())
                ->addViolation()
            ;
        }
    }
private function validateRoles(
        Sharing $constraint,
        SharingIdentityConfigInterface $config,
        array $roles
    ): void {
        if (!empty($roles) && !$config->isPermissible()) {
            $this->context->buildViolation($constraint->identityNotRoleableMessage)
                ->atPath($constraint->roles)
                ->setParameter('%class_property%', $constraint->identityClass)
                ->setParameter('%class%', $config->getType())
                ->addViolation()
            ;
        }
    }
private function validateRoles ( Sharing $ constraint , SharingIdentityConfigInterface $ config , array $ roles ) : void { if ( ! empty ( $ roles ) && ! $ config -> isPermissible ( ) ) { $ this -> context -> buildViolation ( $ constraint -> identityNotRoleableMessage ) -> atPath ( $ constraint -> roles ) -> setParameter ( '%class_property%' , $ constraint -> identityClass ) -> setParameter ( '%class%' , $ config -> getType ( ) ) -> addViolation ( ) ; } }
Validate the roles field.

@param Sharing                        $constraint The sharing constraint
@param SharingIdentityConfigInterface $config     The sharing identity config
@param string[]                       $roles      The roles
Validate the roles field .