public function processValidationErrors(array $validationErrors): void
    {
        if (empty($validationErrors)) {
            return;
        }

        $propertyPathGenerator = $this->propertyPathGenerator;
        foreach ($validationErrors as $i => $error) {
            $message = $error->getTranslatableMessage();
            /** @var \Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $violationBuilder */
            $violationBuilder = $this->context->buildViolation($message instanceof Plural ? $message->plural : $message->message);
            $violationBuilder->setParameters($message->values);

            if ($propertyPathGenerator !== null) {
                $propertyPath = $propertyPathGenerator($i, $error->getTarget());
                if ($propertyPath) {
                    $violationBuilder->atPath($propertyPath);
                }
            }

            $violationBuilder->addViolation();
        }
    }
public function processValidationErrors(array $validationErrors): void
    {
        if (empty($validationErrors)) {
            return;
        }

        $propertyPathGenerator = $this->propertyPathGenerator;
        foreach ($validationErrors as $i => $error) {
            $message = $error->getTranslatableMessage();
            /** @var \Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $violationBuilder */
            $violationBuilder = $this->context->buildViolation($message instanceof Plural ? $message->plural : $message->message);
            $violationBuilder->setParameters($message->values);

            if ($propertyPathGenerator !== null) {
                $propertyPath = $propertyPathGenerator($i, $error->getTarget());
                if ($propertyPath) {
                    $violationBuilder->atPath($propertyPath);
                }
            }

            $violationBuilder->addViolation();
        }
    }
public function processValidationErrors ( array $ validationErrors ) : void { if ( empty ( $ validationErrors ) ) { return ; } $ propertyPathGenerator = $ this -> propertyPathGenerator ; foreach ( $ validationErrors as $ i => $ error ) { $ message = $ error -> getTranslatableMessage ( ) ; /** @var \Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $violationBuilder */ $ violationBuilder = $ this -> context -> buildViolation ( $ message instanceof Plural ? $ message -> plural : $ message -> message ) ; $ violationBuilder -> setParameters ( $ message -> values ) ; if ( $ propertyPathGenerator !== null ) { $ propertyPath = $ propertyPathGenerator ( $ i , $ error -> getTarget ( ) ) ; if ( $ propertyPath ) { $ violationBuilder -> atPath ( $ propertyPath ) ; } } $ violationBuilder -> addViolation ( ) ; } }
Builds constraint violations based on given SPI validation errors.

@param \eZ\Publish\SPI\FieldType\ValidationError[] $validationErrors
Builds constraint violations based on given SPI validation errors .