public static function create(int $type, int $itemsPerPage = 20, array $csvProperties = []): Exporter
    {
        if ($itemsPerPage < 1) {
            throw new InvalidArgumentException('At least one item must be exported per page.');
        }

        switch ($type) {
            case self::TYPE_XML:
                $exporter = new XMLExporter($itemsPerPage);
                break;
            case self::TYPE_CSV:
                $exporter = new CSVExporter($itemsPerPage, $csvProperties);
                break;
            default:
                throw new InvalidArgumentException('Unsupported exporter type.');
        }

        return $exporter;
    }