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.
Completed
Push — master ( cd59f8...9e7309 )
by Aden
25:22
created

RouteServiceProvider::map()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace LaravelFlare\Flare\Providers\LTS;
4
5
use Illuminate\Routing\Router;
6
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7
8
class RouteServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * This namespace is applied to the controller routes in your routes file.
12
     *
13
     * In addition, it is set as the URL generator's root namespace.
14
     *
15
     * @var string
16
     */
17
    protected $namespace = '\LaravelFlare\Flare\Http\Controllers';
18
19
    /**
20
     * Define your route model bindings, pattern filters, etc.
21
     *
22
     * @param \Illuminate\Routing\Router $router
23
     */
24
    public function boot(Router $router)
25
    {
26
        parent::boot($router);
27
    }
28
29
    /**
30
     * Define the routes for the application.
31
     *
32
     * @param \Illuminate\Routing\Router $router
33
     */
34
    public function map(Router $router)
35
    {
36
        $this->registerMiddleware($router);
37
        $this->registerDefinedRoutes($router);
38
        $this->registerDefaultRoutes($router);
39
    }
40
41
    /**
42
     * Register all the Flare Provided Middleware and Middleware Groups.
43
     *
44
     * We define flarebase rather than extend an existing middleware stack
45
     * since it is possible that a user has amended the default middleware 
46
     * of their application in a way that could break Flare.
47
     * 
48
     * @param Router $router
49
     */
50
    protected function registerMiddleware(Router $router)
51
    {
52
        $router->middleware('flareauthenticate', \LaravelFlare\Flare\Http\Middleware\FlareAuthenticate::class);
53
        $router->middleware('checkmodelfound', \LaravelFlare\Flare\Http\Middleware\CheckModelFound::class);
54
        $router->middleware('checkpermissions', \LaravelFlare\Flare\Http\Middleware\CheckPermissions::class);
55
    }
56
57
    /**
58
     * Register the Defined Routes.
59
     *
60
     * This registers all the routes which have been defined by
61
     * Admin sections defined in the Application's Flare Config
62
     * (or in the runtime config if anotehr service provider
63
     * has already started manipulating these dynamically).
64
     * 
65
     * @param Router $router
66
     */
67 View Code Duplication
    protected function registerDefinedRoutes(Router $router)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
68
    {
69
        $router->group(
70
            [
71
                'prefix' => \Flare::config('admin_url'),
72
                'as' => 'flare::',
73
                'middleware' => ['flareauthenticate', 'checkpermissions'],
74
            ],
75
            function ($router) {
76
                \Flare::admin()->registerRoutes($router);
77
                $router->get('/', $this->namespace.'\AdminController@getDashboard')->name('dashboard');
78
            }
79
        );
80
    }
81
82
    /**
83
     * Register the Default Routes.
84
     *
85
     * This registers all the default routes which are included
86
     * with Flare. These consist of things which will probably
87
     * be included with every application such as the login,
88
     * logout and password reset forms.
89
     *
90
     * The login form can however be hidden by setting the 
91
     * 'show' config for 'login' to false.
92
     * 
93
     * @param Router $router
94
     */
95
    protected function registerDefaultRoutes(Router $router)
96
    {
97
        $router->group(
98
            [
99
                'prefix' => \Flare::config('admin_url'),
100
                'as' => 'flare::',
101
            ],
102 View Code Duplication
            function ($router) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
103
                // Logout route...
104
                $router->get('logout', $this->namespace.'\AdminController@getLogout')->name('logout');
105
106
                if (\Flare::show('login')) {
107
                    // Login request reoutes...
108
                    $router->get('login', $this->namespace.'\AdminController@getLogin')->name('login');
109
                    $router->post('login', $this->namespace.'\AdminController@postLogin')->name('login');
110
111
                    // Password reset link request routes...
112
                    $router->get('email', $this->namespace.'\AdminController@getEmail')->name('email');
113
                    $router->post('email', $this->namespace.'\AdminController@postEmail')->name('email');
114
115
                    // Password reset routes...
116
                    $router->get('reset/{token}', $this->namespace.'\AdminController@getReset')->name('reset');
117
                    $router->post('reset', $this->namespace.'\AdminController@postReset')->name('reset');
118
                }
119
            }
120
        );
121
    }
122
}
123