ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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