Completed
Push — master ( aee6dd...1bfaa5 )
by ARCANEDEV
19:13 queued 04:22
created

FoundationServiceProvider::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
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php namespace Arcanesoft\Foundation;
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 FoundationServiceProvider extends PackageServiceProvider
0 ignored issues
show
Bug introduced by
There is one abstract method getBasePath in this class; you could implement it, or declare this class as abstract.
Loading history...
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * Package name.
19
     *
20
     * @var string
21
     */
22
    protected $package = 'foundation';
23
24
    /* -----------------------------------------------------------------
25
     |  Main Methods
26
     | -----------------------------------------------------------------
27
     */
28
    /**
29
     * Register the service provider.
30
     */
31
    public function register()
32
    {
33 21
        parent::register();
34
35 21
        $this->registerConfig();
36
        $this->registerSidebarItems();
37
        $this->registerProviders([
38
            Providers\PackagesServiceProvider::class,
39
            Providers\AuthorizationServiceProvider::class,
40
        ]);
41
        $this->registerModuleProviders();
42
        $this->registerConsoleServiceProvider(Providers\CommandServiceProvider::class);
43
        $this->registerFoundationService();
44
    }
45 21
46
    /**
47 21
     * Boot the service provider.
48
     */
49 21
    public function boot()
50 21
    {
51 21
        $this->registerProviders([
52 21
            Providers\RouteServiceProvider::class,
53
            Providers\ViewComposerServiceProvider::class,
54
        ]);
55 21
56 21
        // Publishes
57 21
        $this->publishConfig();
58 21
        $this->publishViews();
59
        $this->publishTranslations();
60
        $this->publishSidebarItems();
61
    }
62
63 21
    /**
64
     * Get the services provided by the provider.
65 21
     *
66 21
     * @return array
67
     */
68
    public function provides()
69
    {
70
        return [
71 21
            Contracts\Foundation::class,
72 21
        ];
73 21
    }
74 21
75 21
    /* -----------------------------------------------------------------
76
     |  Services Functions
77
     | -----------------------------------------------------------------
78
     */
79
    /**
80
     * Register Foundation service.
81
     */
82 3
    private function registerFoundationService()
83
    {
84
        $this->singleton(Contracts\Foundation::class, Foundation::class);
85 3
    }
86
87
    /**
88
     * Register ARCANESOFT's modules (providers).
89
     */
90
    private function registerModuleProviders()
91
    {
92
        $this->registerProviders(
93
            $this->config()->get('arcanesoft.foundation.modules.providers', [])
94
        );
95
    }
96
}
97