InitializerServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 39
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 20 2
A register() 0 9 1
1
<?php
2
3
namespace MadWeb\Initializer;
4
5
use Illuminate\Support\ServiceProvider;
6
use MadWeb\Initializer\Console\Commands\InstallCommand;
7
use MadWeb\Initializer\Console\Commands\UpdateCommand;
8
use MadWeb\Initializer\Contracts\Runner;
9
use NunoMaduro\LaravelConsoleTask\LaravelConsoleTaskServiceProvider;
10
11
class InitializerServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     */
16 210
    public function boot()
17
    {
18 210
        $this->publishes([
19 210
            __DIR__.'/../config/initializer.php' => config_path('initializer.php'),
20 210
        ], 'config');
21
22 210
        $this->publishes([
23 210
            __DIR__.'/../stubs/install-class.stub' => app_path('Install.php'),
24 210
            __DIR__.'/../stubs/update-class.stub' => app_path('Update.php'),
25 210
        ], 'initializers');
26
27 210
        $this->app->register(LaravelConsoleTaskServiceProvider::class);
28
29 210
        if ($this->app->runningInConsole()) {
30 210
            $this->commands([
31 210
                InstallCommand::class,
32
                UpdateCommand::class,
33
            ]);
34
        }
35 210
    }
36
37
    /**
38
     * Register the application services.
39
     */
40 210
    public function register()
41
    {
42 210
        $this->mergeConfigFrom(__DIR__.'/../config/initializer.php', 'initializer');
43
44 210
        $this->app->bind('app.installer', \App\Install::class);
45 210
        $this->app->bind('app.updater', \App\Update::class);
46
47 210
        $this->app->bind(Runner::class, Run::class);
48 210
    }
49
}
50