ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 10
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace LaraBlockList;
4
5
use LaraBlockList\Console\Commands\CheckForBlocklistCommand;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9 7
    public function boot()
10
    {
11 7
        if ($this->app->runningInConsole()) {
12 7
            $this->publishes([
13 7
                __DIR__ . '/../config/blocklist.php' => config_path('blocklist.php'),
14 7
            ], 'config');
15
16
17 7
            $this->commands([
18 7
                CheckForBlocklistCommand::class,
19 7
            ]);
20
        }
21
    }
22
23
    /**
24
     * @inheritDoc
25
     */
26 7
    public function register()
27
    {
28 7
        $this->mergeConfigFrom(__DIR__ . '/../config/blocklist.php', 'blocklist');
29
    }
30
}
31