GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

LumenServiceProvider::bootConfigure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Milkmeowo\Framework\Base\Providers;
4
5
use Clockwork\Support\Lumen\ClockworkMiddleware;
6
use Clockwork\Support\Lumen\ClockworkServiceProvider;
7
use Dingo\Api\Provider\LumenServiceProvider as DingoLumen;
8
use Barryvdh\Cors\LumenServiceProvider as CorsServiceProvider;
9
use Dingo\Api\Http\Middleware\Request as DingoMiddlewareRequest;
10
use Milkmeowo\Framework\Dingo\Providers\LumenEventsServiceProvider as DingoEvents;
11
use Dusterio\LumenPassport\PassportServiceProvider as LumenPassportServiceProvider;
12
use Milkmeowo\Framework\Dingo\Providers\ExceptionHandlerServiceProvider as DingoExceptionHandler;
13
14
class LumenServiceProvider extends BaseServiceProvider
15
{
16
    public function boot()
17
    {
18
        parent::boot();
19
20
        $this->bootConfigure();
21
22
        $this->bootMiddleware();
23
    }
24
25
    protected function bootConfigure()
26
    {
27
        // l5-repository
28
        $this->app->configure('repository');
0 ignored issues
show
Bug introduced by
The method configure() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean registerConfiguredProviders()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
29
30
        // cors
31
        $this->app->configure('cors');
0 ignored issues
show
Bug introduced by
The method configure() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean registerConfiguredProviders()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
32
    }
33
34
    protected function bootMiddleware()
35
    {
36
        if ($this->app->environment() !== 'production') {
37
            $this->app->middleware([
0 ignored issues
show
Bug introduced by
The method middleware() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
                'clockwork' => ClockworkMiddleware::class,
39
            ]);
40
            // Register into dingo api middleware
41
            $this->app[DingoMiddlewareRequest::class]->mergeMiddlewares([
42
                'clockwork' => ClockworkMiddleware::class,
43
            ]);
44
        }
45
    }
46
47
    public function register()
48
    {
49
        parent::register();
50
51
        $this->registerRepository();
52
53
        $this->registerDingo();
54
55
        $this->registerPassport();
56
57
        $this->registerClockwork();
58
59
        $this->registerCors();
60
    }
61
62
    protected function registerClockwork()
63
    {
64
        if ($this->app->environment() !== 'production') {
65
            $this->app->register(ClockworkServiceProvider::class);
66
        }
67
    }
68
69
    protected function registerRepository()
70
    {
71
        // l5-repository validator
72
        $this->app->bind('Symfony\Component\Translation\TranslatorInterface', function ($app) {
73
            return $app['translator'];
74
        });
75
    }
76
77
    protected function registerDingo()
78
    {
79
        // dingo api
80
        $this->app->register(DingoLumen::class);
81
        $this->app->register(DingoExceptionHandler::class);
82
        $this->app->register(DingoEvents::class);
83
    }
84
85
    protected function registerPassport()
86
    {
87
        // lumen passport support
88
        $this->app->register(LumenPassportServiceProvider::class);
89
    }
90
91
    protected function registerCors()
92
    {
93
        $this->app->register(CorsServiceProvider::class);
94
    }
95
}
96