public static function create(ValidatorInterface $validator): self
    {
        $ex = new self($validator->getErrors());
        $ex->validator = $validator;

        return $ex;
    }
public static function create(ValidatorInterface $validator): self
    {
        $ex = new self($validator->getErrors());
        $ex->validator = $validator;

        return $ex;
    }
public static function create ( ValidatorInterface $ validator ) : self { $ ex = new self ( $ validator -> getErrors ( ) ) ; $ ex -> validator = $ validator ; return $ ex ; }
Create a validation exception from a validator.

@param ValidatorInterface $validator
@return ValidationException
Create a validation exception from a validator .