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.

LocalEnvironmentServiceProvider   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 67
rs 10
c 0
b 0
f 0
wmc 7
lcom 1
cbo 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerServiceProviders() 0 6 2
A registerFacadeAliases() 0 7 2
A boot() 0 7 2
A register() 0 4 1
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Foundation\AliasLoader;
6
use Illuminate\Support\Facades\App;
7
use Illuminate\Support\ServiceProvider;
8
9
class LocalEnvironmentServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Service Providers only should be loaded in development.
13
     *
14
     * @var array
15
     */
16
    protected $localProviders = [
17
        \Barryvdh\Debugbar\ServiceProvider::class,
18
        \Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
19
        \Laravel\Tinker\TinkerServiceProvider::class,
20
    ];
21
22
    /**
23
     * Facade aliases only should be loaded in development.
24
     *
25
     * @var array
26
     */
27
    protected $facadeAliases = [
28
        'Debugbar' => \Barryvdh\Debugbar\Facade::class,
29
    ];
30
31
    /**
32
     * Register Service Providers.
33
     */
34
    protected function registerServiceProviders()
35
    {
36
        foreach ($this->localProviders as $provider) {
37
            $this->app->register($provider);
38
        }
39
    }
40
41
    /**
42
     * Register Facade aliases
43
     * Base file Alias load is /config/app.php => aliases.
44
     */
45
    public function registerFacadeAliases()
46
    {
47
        $loader = AliasLoader::getInstance();
48
        foreach ($this->facadeAliases as $alias => $facade) {
49
            $loader->alias($alias, $facade);
50
        }
51
    }
52
53
    /**
54
     * Register the specific service prodiders and facade aliases only if in .env file APP_ENV = local.
55
     *
56
     * @return void
57
     */
58
    public function boot()
59
    {
60
        if (App::environment('local')) {
0 ignored issues
show
Unused Code introduced by
The call to App::environment() has too many arguments starting with 'local'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
61
            $this->registerServiceProviders();
62
            $this->registerFacadeAliases();
63
        }
64
    }
65
66
    /**
67
     * Register the application services.
68
     *
69
     * @return void
70
     */
71
    public function register()
72
    {
73
        //
74
    }
75
}
76