MultiAuthCommandServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 6
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 5 1
A registerInstallCommand() 0 13 1
1
<?php
2
3
namespace iMokhles\MultiAuthCommand;
4
5
use Illuminate\Database\Migrations\MigrationCreator;
6
use Illuminate\Support\Composer;
7
use Illuminate\Support\ServiceProvider;
8
use iMokhles\MultiAuthCommand\Command\MultiAuthListThemes;
9
use iMokhles\MultiAuthCommand\Command\MultiAuthPrepare;
10
11
class MultiAuthCommandServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     *
16
     * @return void
17
     */
18
    public function boot()
19
    {
20
        //
21
    }
22
23
    /**
24
     * Register the application services.
25
     *
26
     * @return void
27
     */
28
    public function register()
29
    {
30
        //
31
        $this->registerInstallCommand();
32
    }
33
34
    /**
35
     * Register the make:multi-auth command.
36
     */
37
    private function registerInstallCommand()
38
    {
39
        $this->app->singleton('command.imokhles.make.multi-auth', function ($app) {
40
            return new MultiAuthPrepare(new MigrationCreator($app['files'], $app->basePath('Stubs')), new Composer($app['files']));
41
        });
42
        $this->app->singleton('command.imokhles.make.multi-auth.list-themes', 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...
43
            return new MultiAuthListThemes();
44
        });
45
        $this->commands([
46
            'MultiAuthPrepare' => 'command.imokhles.make.multi-auth',
47
            'MultiAuthListThemes' => 'command.imokhles.make.multi-auth.list-themes',
48
        ]);
49
    }
50
}
51
52