Completed
Push — master ( 56bd52...cf94f2 )
by ARCANEDEV
8s
created

AbstractManager::getDriverExporter()   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
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php namespace Arcanedev\LaravelExcel;
2
3
use Illuminate\Support\Manager;
4
5
/**
6
 * Class     AbstractManager
7
 *
8
 * @package  Arcanedev\LaravelExcel
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
abstract class AbstractManager extends Manager
12
{
13
    /* -----------------------------------------------------------------
14
     |  Getters & Setters
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Get the config repository.
20
     *
21
     * @return \Illuminate\Contracts\Config\Repository
22
     */
23 21
    protected function config()
24
    {
25 21
        return $this->app['config'];
26
    }
27
28
    /**
29
     * Get the default driver name.
30
     *
31
     * @return string
32
     */
33 3
    public function getDefaultDriver()
34
    {
35 3
        return $this->config()->get('excel.default');
36
    }
37
38
    /* -----------------------------------------------------------------
39
     |  Other Methods
40
     | -----------------------------------------------------------------
41
     */
42
43
    /**
44
     * Get the driver's exporter class.
45
     *
46
     * @param  string  $driver
47
     *
48
     * @return string
49
     */
50 9
    protected function getDriverExporter($driver)
51
    {
52 9
        return $this->config()->get("excel.drivers.$driver.exporter");
53
    }
54
55
    /**
56
     * Get the driver's importer class.
57
     *
58
     * @param  string  $driver
59
     *
60
     * @return string
61
     */
62 12
    protected function getDriverImporter($driver)
63
    {
64 12
        return $this->config()->get("excel.drivers.$driver.importer");
65
    }
66
67
    /**
68
     * Get the driver options.
69
     *
70
     * @param  string  $driver
71
     *
72
     * @return array
73
     */
74 21
    protected function getDriverOptions($driver)
75
    {
76 21
        return $this->config()->get("excel.drivers.$driver.options", []);
77
    }
78
}
79