ServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 26
rs 10
c 0
b 0
f 0
ccs 14
cts 14
cp 1
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerMigrations() 0 4 2
A boot() 0 12 2
A register() 0 3 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