Completed
Push — master ( b18049...fde562 )
by ARCANEDEV
04:03
created

FoundationServiceProvider::provides()   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
use Arcanesoft\Core\CoreServiceProvider;
5
6
/**
7
 * Class     FoundationServiceProvider
8
 *
9
 * @package  Arcanesoft\Foundation
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class FoundationServiceProvider extends PackageServiceProvider
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Properties
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Package name.
20
     *
21
     * @var string
22
     */
23
    protected $package = 'foundation';
24
25
    /* ------------------------------------------------------------------------------------------------
26
     |  Getters & Setters
27
     | ------------------------------------------------------------------------------------------------
28
     */
29
    /**
30
     * Get the base path of the package.
31
     *
32
     * @return string
33
     */
34 12
    public function getBasePath()
35
    {
36 12
        return dirname(__DIR__);
37
    }
38
39
    /* ------------------------------------------------------------------------------------------------
40
     |  Main Functions
41
     | ------------------------------------------------------------------------------------------------
42
     */
43
    /**
44
     * Register the service provider.
45
     */
46 12
    public function register()
47
    {
48 12
        $this->registerConfig();
49 12
        $this->registerSidebarItems();
50 12
        $this->registerProviders([
51 12
            CoreServiceProvider::class,
52 6
            Providers\PackagesServiceProvider::class,
53 6
            Providers\ModuleServiceProvider::class,
54 6
            Providers\AuthorizationServiceProvider::class,
55 6
        ]);
56 12
        $this->registerConsoleServiceProvider(Providers\CommandServiceProvider::class);
57 12
        $this->registerFoundationService();
58 12
    }
59
60
    /**
61
     * Boot the service provider.
62
     */
63 12
    public function boot()
64
    {
65 12
        $this->registerProviders([
66 12
            Providers\RouteServiceProvider::class,
67 6
            Providers\ComposerServiceProvider::class,
68 6
        ]);
69
70
        // Publishes
71 12
        $this->publishConfig();
72 12
        $this->publishViews();
73 12
        $this->publishTranslations();
74 12
        $this->publishSidebarItems();
75 12
    }
76
77
    /**
78
     * Get the services provided by the provider.
79
     *
80
     * @return array
81
     */
82 2
    public function provides()
83
    {
84 2
        return ['arcanesoft.foundation'];
85
    }
86
87
    /* ------------------------------------------------------------------------------------------------
88
     |  Services Functions
89
     | ------------------------------------------------------------------------------------------------
90
     */
91
    /**
92
     * Register Foundation service.
93
     */
94 12
    private function registerFoundationService()
95
    {
96 12
        $this->singleton('arcanesoft.foundation', Foundation::class);
97 12
    }
98
}
99