ServiceProvider   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 36
ccs 18
cts 18
cp 1
rs 10
wmc 7

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 2
A registerRoutes() 0 4 2
A registerMigrations() 0 4 2
A register() 0 3 1
1
<?php
2
3
namespace LinkRestrictedAccess;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 19
    public function boot()
8
    {
9 19
        $this->registerRoutes();
10
11 19
        if ($this->app->runningInConsole()) {
12 19
            $this->registerMigrations();
13
14 19
            $this->publishes([
15 19
                __DIR__.'/../config/restricted-access.php' => config_path('restricted-access.php'),
16 19
            ], 'config');
17
18
19 19
            $this->commands([
20 19
                //
21 19
            ]);
22
        }
23
    }
24
25 19
    public function register()
26
    {
27 19
        $this->mergeConfigFrom(__DIR__.'/../config/restricted-access.php', 'restricted-access');
28
    }
29
30 19
    protected function registerMigrations()
31
    {
32 19
        if (RestrictedAccess::$runsMigrations) {
33 19
            $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
34
        }
35
    }
36
37 19
    protected function registerRoutes()
38
    {
39 19
        if (RestrictedAccess::$registersRoutes) {
40 19
            $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
41
        }
42
    }
43
}
44