Completed
Push — master ( 9d8964...8d69c4 )
by Brian
02:27
created

RouteListServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 2.0014

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 13
cts 14
cp 0.9286
rs 9.568
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2.0014
1
<?php
2
3
namespace Bmatovu\RouteList;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class RouteListServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14 1
    public function boot()
15
    {
16 1
        if (config('route-list.debug') != config('app.debug')) {
17
            return;
18
        }
19
20 1
        $this->loadViewComponentsAs('', [
21 1
            View\Components\RouteList::class,
22
        ]);
23
24 1
        $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
25
26 1
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'route-list');
27
28 1
        $this->publishes([
29 1
            __DIR__.'/../config/route-list.php' => config_path('route-list.php'),
30 1
        ], 'config');
31
32 1
        $this->publishes([
33 1
            __DIR__.'/../public/vendor/route-list' => public_path('vendor/route-list'),
34 1
        ], 'public');
35 1
    }
36
37
    /**
38
     * Register the application services.
39
     *
40
     * @return void
41
     */
42 1
    public function register()
43
    {
44 1
        $this->mergeConfigFrom(__DIR__.'/../config/route-list.php', 'route-list');
45 1
    }
46
}
47