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

ApiDocGeneratorServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 14 1
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