ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 42
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A boot() 0 6 1
A registerCommands() 0 14 1
1
<?php
2
3
namespace VueGenerators;
4
5
use VueGenerators\Commands\MakeMixin;
6
use VueGenerators\Commands\MakeComponent;
7
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
8
9
class ServiceProvider extends BaseServiceProvider
10
{
11
    /**
12
     * Register bindings in the container.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        $this->registerCommands();
19
    }
20
21
    /**
22
     * Perform post-registration booting of services.
23
     *
24
     * @return void
25
     */
26
    public function boot()
27
    {
28
        $this->publishes([
29
            __DIR__.'/config.php' => config_path('vue-generators.php'),
30
        ], 'config');
31
    }
32
33
    /**
34
     * Register Artisan commands.
35
     */
36
    protected function registerCommands()
37
    {
38
        $this->app->singleton('command.vueg.component', function ($app) {
39
            return $app[MakeComponent::class];
40
        });
41
42
        $this->app->singleton('command.vueg.mixin', function ($app) {
43
            return $app[MakeMixin::class];
44
        });
45
46
        $this->commands('command.vueg.component');
47
48
        $this->commands('command.vueg.mixin');
49
    }
50
}
51