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.

LaravelServiceProvider::bootMiddleware()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 7
c 1
b 1
f 0
nc 2
nop 0
dl 0
loc 14
rs 9.4285
1
<?php
2
3
namespace Milkmeowo\Framework\Base\Providers;
4
5
use Clockwork\Support\Laravel\ClockworkMiddleware;
6
use Clockwork\Support\Laravel\ClockworkServiceProvider;
7
use Barryvdh\Cors\ServiceProvider as CorsServiceProvider;
8
use Dingo\Api\Provider\LaravelServiceProvider as DingoLaravel;
9
use Dingo\Api\Http\Middleware\Request as DingoMiddlewareRequest;
10
use Milkmeowo\Framework\Dingo\Providers\LaravelEventsServiceProvider as DingoEvents;
11
use Milkmeowo\Framework\Dingo\Providers\ExceptionHandlerServiceProvider as DingoExceptionHandler;
12
13
class LaravelServiceProvider extends BaseServiceProvider
14
{
15
    public function boot()
16
    {
17
        parent::boot();
18
19
        $this->bootMiddleware();
20
    }
21
22
    protected function bootMiddleware()
23
    {
24
        $httpKernel = app('Illuminate\Contracts\Http\Kernel');
25
        // Global middleware
26
        if ($this->app->environment() !== 'production') {
27
            $httpKernel->pushMiddleware(
28
                ClockworkMiddleware::class
29
            );
30
            // Register into dingo api middleware
31
            $this->app[DingoMiddlewareRequest::class]->mergeMiddlewares([
32
                'clockwork' => ClockworkMiddleware::class,
33
            ]);
34
        }
35
    }
36
37
    public function register()
38
    {
39
        parent::register();
40
41
        $this->registerDingo();
42
43
        $this->registerClockwork();
44
45
        $this->registerCors();
46
    }
47
48
    protected function registerClockwork()
49
    {
50
        if ($this->app->environment() !== 'production') {
51
            $this->app->register(ClockworkServiceProvider::class);
52
        }
53
    }
54
55
    protected function registerDingo()
56
    {
57
        // dingo api
58
        $this->app->register(DingoLaravel::class);
59
        $this->app->register(DingoExceptionHandler::class);
60
        $this->app->register(DingoEvents::class);
61
    }
62
63
    protected function registerCors()
64
    {
65
        $this->app->register(CorsServiceProvider::class);
66
    }
67
}
68