ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0
ccs 14
cts 14
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 1
A register() 0 7 1
1
<?php
2
/**
3
 * CalamandreiLorenzo\LaravelVersionable
4
 * This file is part of the overtrue/laravel-versionable.
5
 * ------------------------------------------------------
6
 * (c) overtrue <[email protected]>
7
 * This source file is subject to the MIT license that is bundled.
8
 */
9
10
namespace CalamandreiLorenzo\LaravelVersionable;
11
12
use function config_path;
13
use function database_path;
14
15
/**
16
 * Class ServiceProvider.
17
 * @author 安正超 - overtrue
18
 * @github https://github.com/overtrue
19
 */
20
class ServiceProvider extends \Illuminate\Support\ServiceProvider
21
{
22
    /**
23
     * boot
24
     */
25 8
    public function boot(): void
26
    {
27 8
        $this->loadMigrationsFrom(__DIR__ . '/../migrations');
28
29 8
        $this->publishes([
30 8
            __DIR__ . '/../migrations' => database_path('migrations'),
31 8
        ], 'migrations');
32
33 8
        $this->publishes([
34 8
            __DIR__ . '/../config/versionable.php' => config_path('versionable.php'),
35 8
        ], 'config');
36 8
    }
37
38
    /**
39
     * register
40
     */
41 8
    public function register(): void
42
    {
43 8
        $this->mergeConfigFrom(
44 8
            __DIR__ . '/../config/versionable.php',
45 8
            'versionable'
46
        );
47 8
    }
48
}
49