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

ExporterManager   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 55
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 4 1
A createExcelDriver() 0 6 1
A createCsvDriver() 0 6 1
A createOpenOfficeDriver() 0 6 1
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