ReComposerServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 8
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 15
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SolumDeSignum\ReComposer;
6
7
use Illuminate\Support\ServiceProvider;
8
9
class ReComposerServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * @var string
13
     */
14
    public static string $alias = 'recomposer';
15
16
    /**
17
     * @var string
18
     */
19
    public static string $namespaceSuffix = 'solumdesignum';
20
21
    /**
22
     * Boot up the package. Load the views from the correct directory.
23
     */
24
    public function boot(): void
25
    {
26
        $this->loadViewsFrom(
27
            __DIR__.'/../resources/views',
28
            self::$namespaceSuffix.'/'.self::$alias
29
        );
30
31
        if ($this->app->runningInConsole()) {
32
            $this->publishes(
33
                [
34
                    __DIR__.'/../config/recomposer.php' => config_path(
35
                        'recomposer.php'
36
                    ),
37
                ],
38
                'config'
39
            );
40
        }
41
    }
42
43
    public function register(): void
44
    {
45
        $this->mergeConfigFrom(
46
            __DIR__.'/../config/recomposer.php',
47
            'recomposer'
48
        );
49
    }
50
}
51