Completed
Push — master ( 89feee...d7dce4 )
by ARCANEDEV
14:12
created

LaravelNotesServiceProvider::boot()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 3
nc 3
nop 0
crap 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 ? $this->publishMigrations() : $this->loadMigrations();
53
        }
54 66
    }
55
}
56