DatabaseSynchronizerServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 2
A register() 0 3 1
A bootForConsole() 0 4 1
1
<?php
2
3
namespace mtolhuijs\LDS;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class DatabaseSynchronizerServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Perform post-registration booting of services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        if ($this->app->runningInConsole()) {
17
            $this->bootForConsole();
18
        }
19
20
        $this->publishes([
21
            __DIR__.'/../config/database-synchronizer.php' => config_path('database-synchronizer.php'),
22
        ]);
23
    }
24
25
    /**
26
     * Register any package services.
27
     *
28
     * @return void
29
     */
30
    public function register()
31
    {
32
        $this->mergeConfigFrom(__DIR__.'/../config/database-synchronizer.php', 'database-synchronizer');
33
    }
34
35
    /**
36
     * Console-specific booting.
37
     *
38
     * @return void
39
     */
40
    protected function bootForConsole()
41
    {
42
        $this->commands([
43
            Commands\Synchronise::class,
44
        ]);
45
    }
46
}
47