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

LaravelExcelServiceProvider::getBasePath()   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 0
crap 1
1
<?php namespace Arcanedev\LaravelExcel;
2
3
use Arcanedev\Support\PackageServiceProvider;
4
5
/**
6
 * Class     LaravelExcelServiceProvider
7
 *
8
 * @package  Arcanedev\LaravelExcel
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class LaravelExcelServiceProvider extends PackageServiceProvider
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Package name.
20
     *
21
     * @var string
22
     */
23
    protected $package = 'excel';
24
25
    /**
26
     * Indicates if loading of the provider is deferred.
27
     *
28
     * @var bool
29
     */
30
    protected $defer   = true;
31
32
    /* -----------------------------------------------------------------
33
     |  Main Methods
34
     | -----------------------------------------------------------------
35
     */
36
37
    /**
38
     * Register the service provider.
39
     */
40 69
    public function register()
41
    {
42 69
        parent::register();
43
44 69
        $this->registerConfig();
45 69
        $this->registerExporterManager();
46 69
        $this->registerImporterManager();
47 69
    }
48
49
    /**
50
     * Boot the service provider.
51
     */
52 69
    public function boot()
53
    {
54 69
        parent::boot();
55 69
    }
56
57
    /**
58
     * Get the services provided by the provider.
59
     *
60
     * @return array
61
     */
62 6
    public function provides()
63
    {
64
        return [
65 6
            Contracts\ExporterManager::class,
66 2
            Contracts\ImporterManager::class,
67 2
        ];
68
    }
69
70
    /* -----------------------------------------------------------------
71
     |  Other Methods
72
     | -----------------------------------------------------------------
73
     */
74
    /**
75
     * Register the exporter manager.
76
     */
77 69
    private function registerExporterManager()
78
    {
79
        $this->singleton(Contracts\ExporterManager::class, function ($app) {
80 12
            return new ExporterManager($app);
81 69
        });
82 69
    }
83
84
    /**
85
     * Register the importer manager.
86
     */
87
    private function registerImporterManager()
88
    {
89 69
        $this->singleton(Contracts\ImporterManager::class, function ($app) {
90 15
            return new ImporterManager($app);
91 69
        });
92 69
    }
93
}
94