Completed
Push — master ( 8c507d...c88164 )
by Marcel
02:20
created

ApiDocGeneratorServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Mpociot\ApiDoc;
4
5
use Illuminate\Support\ServiceProvider;
6
use Mpociot\ApiDoc\Commands\GenerateDocumentation;
7
use Mpociot\ApiDoc\Commands\UpdateDocumentation;
8
9
class ApiDocGeneratorServiceProvider extends ServiceProvider
10
{
11
12
    /**
13
     * Bootstrap the application events.
14
     *
15
     * @return void
16
     */
17
    public function boot()
18
    {
19
        $this->loadViewsFrom(__DIR__.'/../../resources/views/', 'apidoc');
20
    }
21
22
    /**
23
     * Register the API doc commands
24
     */
25
    public function register()
26
    {
27
        $this->app['apidoc.generate'] = $this->app->share(function () {
28
            return new GenerateDocumentation();
29
        });
30
        $this->app['apidoc.update'] = $this->app->share(function () {
31
            return new UpdateDocumentation();
32
        });
33
34
        $this->commands([
35
            'apidoc.generate',
36
            'apidoc.update',
37
        ]);
38
    }
39
40
}
41