Completed
Pull Request — master (#3)
by ARCANEDEV
16:54
created

BackupsServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 2
cts 2
cp 1
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanesoft\Backups;
6
7
use Arcanesoft\Backups\Console\PublishCommand;
8
use Arcanesoft\Foundation\Support\Providers\PackageServiceProvider;
9
10
/**
11
 * Class     BackupsServiceProvider
12
 *
13
 * @author   ARCANEDEV <[email protected]>
14
 */
15
class BackupsServiceProvider extends PackageServiceProvider
16
{
17
    /* -----------------------------------------------------------------
18
     |  Properties
19
     | -----------------------------------------------------------------
20
     */
21
22
    /**
23
     * Package name.
24
     *
25
     * @var string
26
     */
27
    protected $package = 'backups';
28
29
    /**
30
     * Merge multiple config files into one instance (package name as root key)
31
     *
32
     * @var bool
33 4
     */
34
    protected $multiConfigs = true;
35 4
36
    /* -----------------------------------------------------------------
37 4
     |  Main Methods
38 4
     | -----------------------------------------------------------------
39
     */
40 4
41 4
    /**
42
     * Register the service provider.
43
     */
44
    public function register(): void
45 4
    {
46 4
        $this->registerConfig();
47
48
        $this->registerProviders([
49
            Providers\AuthServiceProvider::class,
50
            Providers\RouteServiceProvider::class,
51 4
        ]);
52
53 4
        $this->registerCommands([
54
            PublishCommand::class,
55
        ]);
56 4
    }
57 4
58 4
    /**
59 4
     * Boot the service provider.
60 4
     */
61
    public function boot(): void
62
    {
63
        $this->loadTranslations();
64
        $this->loadViews();
65
66
        if ($this->app->runningInConsole()) {
67 2
            $this->publishConfig();
68
            $this->publishTranslations();
69
            $this->publishViews();
70
        }
71 2
    }
72
}
73