ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 20
ccs 0
cts 13
cp 0
rs 9.9
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace NovaAdDirector;
4
5
use NovaAdDirector\Console\Commands\AdConfigurationCreate;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9
    public function boot()
10
    {
11
        if ($this->app->runningInConsole()) {
12
            $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
13
14
            $this->publishes([
15
                __DIR__ . '/../config/nova-ad-director.php' => config_path('nova-ad-director.php'),
16
            ], 'config');
17
18
            $this->publishes([
19
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/nova-ad-director'),
20
            ], 'lang');
21
22
23
            $this->commands([
24
                AdConfigurationCreate::class,
25
            ]);
26
        }
27
28
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'nova-ad-director');
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function register()
35
    {
36
        $this->mergeConfigFrom(__DIR__ . '/../config/nova-ad-director.php', 'nova-ad-director');
37
    }
38
}
39