Completed
Push — master ( b5ad8c...a739bd )
by ARCANEDEV
06:46 queued 03:42
created

CoreServiceProvider   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 88.89%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 5
c 3
b 0
f 0
lcom 1
cbo 3
dl 0
loc 76
ccs 16
cts 18
cp 0.8889
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getBasePath() 0 4 1
A register() 0 5 1
A boot() 0 4 1
A provides() 0 6 1
A registerArcanesoftDatabase() 0 8 1
1
<?php namespace Arcanesoft\Core;
2
3
use Arcanesoft\Core\Bases\PackageServiceProvider;
4
5
/**
6
 * Class     FoundationServiceProvider
7
 *
8
 * @package  Arcanesoft\Foundation
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CoreServiceProvider extends PackageServiceProvider
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Package name.
19
     *
20
     * @var string
21
     */
22
    protected $package      = 'core';
23
24
    /* ------------------------------------------------------------------------------------------------
25
     |  Getters & Setters
26
     | ------------------------------------------------------------------------------------------------
27
     */
28
    /**
29
     * Get the base path of the package.
30
     *
31
     * @return string
32
     */
33
    public function getBasePath()
34
    {
35
        return dirname(__DIR__);
36
    }
37
38
    /* ------------------------------------------------------------------------------------------------
39
     |  Main Functions
40
     | ------------------------------------------------------------------------------------------------
41
     */
42
    /**
43
     * Register the service provider.
44
     */
45 8
    public function register()
46
    {
47 8
        $this->registerArcanesoftDatabase();
48 8
        $this->app->register(Providers\PackagesServiceProvider::class);
49 8
    }
50
51
    /**
52
     * Boot the service provider.
53
     */
54 8
    public function boot()
55
    {
56 8
        $this->app->register(Providers\RouteServiceProvider::class);
57 8
    }
58
59
    /**
60
     * Get the services provided by the provider.
61
     *
62
     * @return array
63
     */
64 4
    public function provides()
65
    {
66
        return [
67
            //
68 4
        ];
69
    }
70
71
    /* ------------------------------------------------------------------------------------------------
72
     |  Services Functions
73
     | ------------------------------------------------------------------------------------------------
74
     */
75
    /**
76
     * Register Foundation database.
77
     */
78 8
    private function registerArcanesoftDatabase()
79
    {
80 8
        $this->config()->set('database.connections.arcanesoft', [
81 8
            'driver'   => 'sqlite',
82 8
            'database' => storage_path('app/arcanesoft.sqlite'),
83 8
            'prefix'   => '',
84 6
        ]);
85 8
    }
86
}
87