ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 12 1
A boot() 0 8 2
1
<?php
2
3
namespace DDiimmkkaass\Api;
4
5
use DDiimmkkaass\Api\Generator\ApiMakeCommand;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9
    /**
10
     * Register the service provider.
11
     *
12
     * @return void
13
     */
14
    public function register()
15
    {
16
        $this->mergeConfigFrom(
17
            __DIR__.'/config/config.php', 'lumen-api-generator'
18
        );
19
20
        $this->app->singleton('command.api.make', function ($app) {
21
            return new ApiMakeCommand($app['files']);
22
        });
23
24
        $this->commands('command.api.make');
25
    }
26
27
    /**
28
     * Bootstrap the application events.
29
     */
30
    public function boot()
31
    {
32
        $routes = config('lumen-api-generator.routes_file');
33
        
34
        if ($routes) {
35
            require app_path($routes);
36
        }
37
    }
38
}
39