ServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
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