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

ImporterManager::getDefaultDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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