SeoServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 7
Bugs 0 Features 0
Metric Value
wmc 4
lcom 2
cbo 1
dl 0
loc 82
ccs 24
cts 24
cp 1
rs 10
c 7
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 15 1
A boot() 0 13 1
A provides() 0 6 1
A publishAssets() 0 6 1
1
<?php namespace Arcanesoft\Seo;
2
3
use Arcanesoft\Core\Bases\PackageServiceProvider;
4
5
/**
6
 * Class     SeoServiceProvider
7
 *
8
 * @package  Arcanesoft\Seo
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class SeoServiceProvider extends PackageServiceProvider
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Package name.
20
     *
21
     * @var string
22
     */
23
    protected $package = 'seo';
24
25
    /* -----------------------------------------------------------------
26
     |  Main Methods
27
     | -----------------------------------------------------------------
28
     */
29
30
    /**
31
     * Register the service provider.
32
     */
33 16
    public function register()
34
    {
35 16
        parent::register();
36
37 16
        $this->registerConfig();
38 16
        $this->registerSidebarItems();
39 16
        $this->registerProviders([
40 16
            Providers\AuthorizationServiceProvider::class,
41
            Providers\PackagesServiceProvider::class,
42
            Providers\RouteServiceProvider::class,
43
            Providers\ViewComposerServiceProvider::class,
44
        ]);
45
46 16
        $this->registerConsoleServiceProvider(Providers\CommandServiceProvider::class);
47 16
    }
48
49
    /**
50
     * Boot the service provider.
51
     */
52 16
    public function boot()
53
    {
54 16
        parent::boot();
55
56
        // Publishes
57 16
        $this->publishConfig();
58 16
        $this->publishViews();
59 16
        $this->publishTranslations();
60 16
        $this->publishSidebarItems();
61 16
        $this->publishAssets();
62
63 16
        $this->loadMigrations();
64 16
    }
65
66
    /**
67
     * Get the services provided by the provider.
68
     *
69
     * @return array
70
     */
71 2
    public function provides()
72
    {
73
        return [
74
            //
75 2
        ];
76
    }
77
78
    /* -----------------------------------------------------------------
79
     |  Other Methods
80
     | -----------------------------------------------------------------
81
     */
82
83
    /**
84
     * Publish the assets.
85
     */
86 16
    private function publishAssets()
87
    {
88 16
        $this->publishes([
89 16
            $this->getResourcesPath().DS.'assets'.DS => resource_path("assets/_{$this->vendor}/{$this->package}"),
90 16
        ], 'assets');
91 16
    }
92
}
93