src/ViolationListException.php
public static function create(ConstraintViolationListInterface $violationList, $code = 0, \Exception $prev = null)
    {
        $violationMessages = [];

        /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
        foreach ($violationList as $violation) {
            $violationMessages[] = sprintf(
                '[%s]: %s;',
                $violation->getPropertyPath(),
                $violation->getMessage()
            );
        }

        $message = 'Not valid. ' . implode(' ', $violationMessages);

        return new static($violationList, $message, $code, $prev);
    }
public static function create(ConstraintViolationListInterface $violationList, $code = 0, \Exception $prev = null)
    {
        $violationMessages = [];

        /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
        foreach ($violationList as $violation) {
            $violationMessages[] = sprintf(
                '[%s]: %s;',
                $violation->getPropertyPath(),
                $violation->getMessage()
            );
        }

        $message = 'Not valid. ' . implode(' ', $violationMessages);

        return new static($violationList, $message, $code, $prev);
    }
public static function create ( ConstraintViolationListInterface $ violationList , $ code = 0 , \ Exception $ prev = null ) { $ violationMessages = [ ] ; /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */ foreach ( $ violationList as $ violation ) { $ violationMessages [ ] = sprintf ( '[%s]: %s;' , $ violation -> getPropertyPath ( ) , $ violation -> getMessage ( ) ) ; } $ message = 'Not valid. ' . implode ( ' ' , $ violationMessages ) ; return new static ( $ violationList , $ message , $ code , $ prev ) ; }
Create a new instance with violation list

@param ConstraintViolationListInterface $violationList
@param int                              $code
@param \Exception                       $prev

@return ViolationListException
Create a new instance with violation list