SetupWizardServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 2
Metric Value
wmc 5
c 5
b 0
f 2
lcom 1
cbo 2
dl 0
loc 57
ccs 21
cts 21
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 5 1
A registerCommand() 0 6 1
A registerConfig() 0 7 1
A provides() 0 6 1
1
<?php namespace Lanin\Laravel\SetupWizard;
2
3
use Illuminate\Support\ServiceProvider;
4
use Lanin\Laravel\SetupWizard\Commands\Setup;
5
6
class SetupWizardServiceProvider extends ServiceProvider
7
{
8
9
    /**
10
     * Bootstrap application service.
11
     */
12 136
    public function boot()
13
    {
14 136
        $this->publishes([
15 136
            __DIR__ . '/../config/setup.php' => config_path('setup.php'),  
16 136
        ], 'setup');
17 136
    }
18
19
    /**
20
     * Register the service provider.
21
     *
22
     * @return void
23
     */
24 136
    public function register()
25
    {
26 136
        $this->registerCommand();
27 136
        $this->registerConfig();
28 136
    }
29
30
    /**
31
     * Register setup command.
32
     */
33 136
    protected function registerCommand()
34
    {
35 136
        $this->app->bind('setup-wizard.setup', Setup::class);
36
37 136
        $this->commands('setup-wizard.setup');
38 136
    }
39
40
    /**
41
     * Register setup config.
42
     */
43 136
    protected function registerConfig()
44
    {
45 136
        $this->mergeConfigFrom(
46 136
            __DIR__ . '/../config/setup.php',
47
            'setup'
48 136
        );
49 136
    }
50
51
    /**
52
     * Get the services provided by the provider.
53
     *
54
     * @return array
55
     */
56 2
    public function provides()
57
    {
58
        return [
59 2
            'setup-wizard.setup',
60 2
        ];
61
    }
62
}