GeneratorServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 35
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 3 1
A register() 0 22 1
1
<?php
2
3
namespace Recca0120\Generator;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class GeneratorServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap any application services.
11
     */
12
    public function boot()
13
    {
14
    }
15
16
    /**
17
     * Register the service provider.
18
     */
19
    public function register()
20
    {
21
        $this->mergeConfigFrom(__DIR__.'/../config/generator.php', 'generator');
22
23
        $this->publishes([
24
            __DIR__.'/../config/generator.php' => config_path('generator.php'),
25
        ], 'config');
26
27
        $this->publishes([
28
            __DIR__.'/../resources/stubs' => base_path('resources/stubs'),
29
        ], 'stubs');
30
31
        $this->app->singleton(Generator::class, function ($app) {
32
            return new Generator($app['config']['generator']);
33
        });
34
35
        $this->app->singleton(CommandFactory::class, function ($app) {
36
            return new CommandFactory($app['config']['generator'], $app[Generator::class], $app);
37
        });
38
39
        $this->commands($this->app->make(CommandFactory::class)->create());
40
    }
41
}
42