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 ( ffdf05...f97308 )
by Aden
13:37
created

RouteServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace LaravelFlare\Flare\Providers;
4
5
use Illuminate\Routing\Router;
6
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7
8
abstract 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
     * The compatibility version of this RouteServiceProvider.
21
     * 
22
     * @var string
23
     */
24
    protected $compatibilityVersion;
25
26
    /**
27
     * Define the routes for the application.
28
     *
29
     * @param \Illuminate\Routing\Router $router
30
     */
31
    public function map(Router $router)
32
    {
33
        $this->registerMiddleware($router);
34
        $this->registerDefinedRoutes($router);
35
        $this->registerDefaultRoutes($router);
36
    }
37
38
    /**
39
     * Register all the Flare Provided Middleware and Middleware Groups.
40
     *
41
     * We define flarebase rather than extend an existing middleware stack
42
     * since it is possible that a user has amended the default middleware 
43
     * of their application in a way that could break Flare.
44
     * 
45
     * @param Router $router
46
     */
47
    abstract protected function registerMiddleware(Router $router);
48
49
    /**
50
     * Register the Defined Routes.
51
     *
52
     * This registers all the routes which have been defined by
53
     * Admin sections defined in the Application's Flare Config
54
     * (or in the runtime config if anotehr service provider
55
     * has already started manipulating these dynamically).
56
     * 
57
     * @param Router $router
58
     */
59
    abstract protected function registerDefinedRoutes(Router $router);
60
61
    /**
62
     * Register the Default Routes.
63
     *
64
     * This registers all the default routes which are included
65
     * with Flare. These consist of things which will probably
66
     * be included with every application such as the login,
67
     * logout and password reset forms.
68
     *
69
     * The login form can however be hidden by setting the 
70
     * 'show' config for 'login' to false.
71
     * 
72
     * @param Router $router
73
     */
74
    abstract protected function registerDefaultRoutes(Router $router);
75
76
    /**
77
     * Return the Controller or Controller and Route if provided.
78
     * 
79
     * @param string $route
80
     * 
81
     * @return string
82
     */
83
    protected function adminController($route = null)
84
    {
85
        if ($route) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $route of type string|null is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
86
            return $this->namespace.'\\'.$this->compatibilityVersion.'\AdminController@'.$route;
87
        }
88
89
        return $this->namespace.'\\'.$this->compatibilityVersion.'\AdminController';
90
    }
91
}
92