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.

ArtisanServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 4

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 2
cbo 4
dl 0
loc 71
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 2
A registerMakeAdminCommand() 0 6 1
A registerMakeUserCommand() 0 6 1
A provides() 0 4 1
1
<?php
2
3
namespace LaravelFlare\Flare\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use LaravelFlare\Flare\Console\Commands\MakeUserCommand;
7
use LaravelFlare\Flare\Console\Commands\MakeAdminCommand;
8
9
class ArtisanServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = true;
17
18
    /**
19
     * The commands to be registered.
20
     *
21
     * @var array
22
     */
23
    protected $commands = [
24
        'MakeAdmin' => 'command.makeadmin',
25
        'MakeUser' => 'command.makeuser',
26
    ];
27
28
    /**
29
     * Register the service provider.
30
     */
31
    public function register()
32
    {
33
        foreach ($this->commands as $command => $name) {
34
            $method = "register{$command}Command";
35
36
            call_user_func_array([$this, $method], [$name]);
37
        }
38
39
        $this->commands(array_values($this->commands));
40
    }
41
42
    /**
43
     * Register the command.
44
     * 
45
     * @param $command
46
     * 
47
     * @return
48
     */
49
    protected function registerMakeAdminCommand($command)
50
    {
51
        $this->app->singleton($command, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
            return new MakeAdminCommand();
53
        });
54
    }
55
56
    /**
57
     * Register the command.
58
     * 
59
     * @param $command
60
     * 
61
     * @return
62
     */
63
    protected function registerMakeUserCommand($command)
64
    {
65
        $this->app->singleton($command, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
66
            return new MakeUserCommand();
67
        });
68
    }
69
70
    /**
71
     * Get the services provided by the provider.
72
     *
73
     * @return array
74
     */
75
    public function provides()
76
    {
77
        return array_values($this->commands);
78
    }
79
}
80