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   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 10 1
A registerClockwork() 0 6 2
A registerDingo() 0 7 1
A registerCors() 0 4 1
A bootMiddleware() 0 14 2
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