Completed
Pull Request — master (#30)
by ARCANEDEV
10:30 queued 02:03
created

LaravelNotesServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 90.91%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 43
ccs 10
cts 11
cp 0.9091
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 10 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\LaravelNotes;
6
7
use Arcanedev\Support\Providers\PackageServiceProvider;
8
9
/**
10
 * Class     LaravelNotesServiceProvider
11
 *
12
 * @package  Arcanedev\LaravelNotes
13
 * @author   ARCANEDEV <[email protected]>
14
 */
15
class LaravelNotesServiceProvider extends PackageServiceProvider
16
{
17
    /* -----------------------------------------------------------------
18
     |  Properties
19
     | -----------------------------------------------------------------
20
     */
21
22
    /**
23
     * Package name.
24
     *
25
     * @var string
26
     */
27
    protected $package = 'notes';
28
29
    /* -----------------------------------------------------------------
30
     |  Main Methods
31
     | -----------------------------------------------------------------
32
     */
33
34
    /**
35
     * Register the service provider.
36
     */
37 66
    public function register(): void
38
    {
39 66
        parent::register();
40
41 66
        $this->registerConfig();
42 66
    }
43
44
    /**
45
     * Boot the service provider.
46
     */
47 66
    public function boot(): void
48
    {
49 66
        if ($this->app->runningInConsole()) {
50 66
            $this->publishConfig();
51
52 66
            LaravelNotes::$publishMigrations
53
                ? $this->publishMigrations()
54 66
                : $this->loadMigrations();
55
        }
56 66
    }
57
}
58