ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 4
Paths 6

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 10
cc 4
nc 6
nop 0
crap 4
1
<?php
2
3
namespace NovaResourceDynamicExport;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
    /**
8
     * @inheritDoc
9
     */
10 10
    public function boot()
11
    {
12 10
        if (DynamicExport::$useRoutes) {
13 10
            $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
14
        }
15
16 10
        if ($this->app->runningInConsole()) {
17 10
            if (DynamicExport::$runsMigrations) {
18 10
                $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
19
            }
20
21 10
            $this->publishes([
22 10
                __DIR__ . '/../config/nova-resource-dynamic-export.php' => config_path('nova-resource-dynamic-export.php'),
23 10
            ], 'config');
24
        }
25
    }
26
27
    /**
28
     * @inheritDoc
29
     */
30 10
    public function register()
31
    {
32 10
        $this->mergeConfigFrom(__DIR__ . '/../config/nova-resource-dynamic-export.php', 'nova-resource-dynamic-export');
33
    }
34
}
35