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

LaravelNotesServiceProvider::boot()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3.0261

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 7
cp 0.8571
rs 9.9332
c 0
b 0
f 0
cc 3
nc 3
nop 0
crap 3.0261
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