Completed
Push — master ( cf0a63...b69372 )
by ARCANEDEV
17s
created

ExporterManager::getDefaultDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace Arcanedev\LaravelExcel;
2
3
use Arcanedev\LaravelExcel\Contracts\ExporterManager as ExporterManagerContract;
4
5
/**
6
 * Class     ExporterManager
7
 *
8
 * @package  Arcanedev\LaravelExcel
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class ExporterManager extends AbstractManager implements ExporterManagerContract
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Drivers
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Get a exporter instance.
20
     *
21
     * @param  string  $driver
22
     *
23
     * @return \Arcanedev\LaravelExcel\Contracts\Exporter
24
     */
25 9
    public function make($driver)
26
    {
27 9
        return $this->driver($driver);
28
    }
29
30
    /**
31
     * Get the Excel driver instance.
32
     *
33
     * @return \Arcanedev\LaravelExcel\Contracts\Exporter
34
     */
35 3
    public function createExcelDriver()
36
    {
37 3
        return new Exporters\ExcelExporter(
38 3
            $this->getDriverOptions('excel')
39 1
        );
40
    }
41
42
    /**
43
     * Get the CSV driver instance.
44
     *
45
     * @return \Arcanedev\LaravelExcel\Contracts\Exporter
46
     */
47 3
    public function createCsvDriver()
48 1
    {
49 3
        return new Exporters\CsvExporter(
50 3
            $this->getDriverOptions('csv')
51 1
        );
52
    }
53
54
    /**
55
     * Get the Open office driver instance.
56
     *
57
     * @return \Arcanedev\LaravelExcel\Contracts\Exporter
58
     */
59 3
    public function createOpenOfficeDriver()
60
    {
61 3
        return new Exporters\OpenOfficeExporter(
62 3
            $this->getDriverOptions('ods')
63 1
        );
64
    }
65
}
66