ServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerRoutes() 0 4 2
A boot() 0 12 2
A register() 0 3 1
1
<?php
2
3
namespace ThinKit;
4
5
use ThinKit\Console\Commands\DeleteExpiredCommand;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9 22
    public function boot()
10
    {
11 22
        $this->registerRoutes();
12
13 22
        if ($this->app->runningInConsole()) {
14 22
            $this->publishes([
15 22
                __DIR__.'/../config/thinkit.php' => config_path('thinkit.php'),
16 22
            ], 'config');
17
18
19 22
            $this->commands([
20 22
                DeleteExpiredCommand::class,
21 22
            ]);
22
        }
23
    }
24
25 22
    public function register()
26
    {
27 22
        $this->mergeConfigFrom(__DIR__.'/../config/thinkit.php', 'thinkit');
28
    }
29
30 22
    protected function registerRoutes()
31
    {
32 22
        if (TooltKit::$registersRoutes) {
33 22
            $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
34
        }
35
    }
36
}
37