Completed
Pull Request — master (#72)
by D.
08:32 queued 06:02
created

AppServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 90.91%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 31
ccs 10
cts 11
cp 0.9091
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 11 2
A register() 0 6 2
1
<?php
2
3
namespace SET\Providers;
4
5
use Illuminate\Support\Facades\Cache;
6
use Illuminate\Support\ServiceProvider;
7
use SET\Handlers\DBConfigs\DBConfigs;
8
use SET\Setting;
9
10
class AppServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap any application services.
14
     *
15
     * @return void
16
     */
17 162
    public function boot()
18
    {
19
        // Ensure installation is not in progress
20 162
        if ( ! strpos(url()->current(),'install') ) {
21 162
          DBConfigs::execute();
22
        }
23
24 162
        Setting::saving(function ($setting) {
25 10
            Cache::forever($setting->key, $setting->value);
26 162
        });
27 162
    }
28
29
    /**
30
     * Register any application services.
31
     *
32
     * @return void
33
     */
34 162
    public function register()
35
    {
36 162
        if ($this->app->environment() == 'local') {
37
            $this->app->register('Laracasts\Generators\GeneratorsServiceProvider');
38
        }
39 162
    }
40
}
41