ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2

Importance

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