ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 40
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 16 2
A register() 0 6 1
1
<?php namespace Cviebrock\EloquentTaggable;
2
3
use Cviebrock\EloquentTaggable\Services\TagService;
4
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
5
6
7
/**
8
 * Class ServiceProvider
9
 *
10
 * @package Cviebrock\EloquentTaggable
11
 */
12
class ServiceProvider extends LaravelServiceProvider
13
{
14
15
    /**
16
     * @inheritdoc
17
     */
18
    protected $defer = false;
19
20
    /**
21
     * Bootstrap the application events.
22
     */
23
    public function boot(): void
24
    {
25 23
        $this->publishes([
26
            __DIR__ . '/../resources/config/taggable.php' => config_path('taggable.php'),
27 23
        ], 'config');
28 23
29 23
        if (!class_exists('CreateTaggableTable')) {
30
            $this->publishes([
31 23
                __DIR__.'/../resources/database/migrations/create_taggable_table.php.stub' => database_path('migrations/' . date('Y_m_d_His') . '_create_taggable_table.php'),
32
            ], 'migrations');
33 1
        }
34 1
35 1
        $this->loadMigrationsFrom(
36
            __DIR__.'/../resources/database/migrations'
37 1
        );
38 1
    }
39 1
40 1
    /**
41 23
     * Register the service provider.
42
     *
43
     * @return void
44
     */
45
    public function register()
46
    {
47
        $this->mergeConfigFrom(__DIR__ . '/../resources/config/taggable.php', 'taggable');
48 23
49
        $this->app->singleton(TagService::class);
50 23
    }
51
}
52