Passed
Push — main ( 5829ff...81385b )
by ikechukwu
04:19 queued 01:15
created

MagicInitCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 40
c 2
b 0
f 0
dl 0
loc 73
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 52 3
1
<?php
2
3
namespace Ikechukwukalu\Magicmake\Console\Commands;
4
5
class MagicInitCommand extends InitCommands
6
{
7
    /**
8
     * The name and signature of the console command.
9
     *
10
     * @var string
11
     */
12
    protected $signature = 'magic:init';
13
14
    /**
15
     * The console command description.
16
     *
17
     * @var string
18
     */
19
    protected $description = 'Scaffold the numerous classes';
20
21
    /**
22
     * Execute the console command.
23
     *
24
     * @return void
25
     */
26
    public function handle()
27
    {
28
        if (env('APP_ENV', 'production') != 'local') {
0 ignored issues
show
introduced by
The condition env('APP_ENV', 'production') != 'local' is always true.
Loading history...
29
            return;
30
        }
31
32
        if (env('MAGIC_INIT_LOCK', true) === true) {
33
            return;
34
        }
35
36
        $this->handleAppActionPath();
37
        $this->handleAppContractsPath();
38
        $this->handleAppEnumsPath();
39
        $this->handleAppEventsPath();
40
        $this->handleAppExceptionsPath();
41
        $this->handleAppHttpPath();
42
        $this->handleAppHttpControllersPath();
43
        $this->handleAppHttpControllersAuthPath();
44
        $this->handleAppHttpMiddlewarePath();
45
        $this->handleAppHttpRequestsPath();
46
        $this->handleAppHttpRequestsAuthPath();
47
        $this->handleAppListenersPath();
48
        $this->handleAppModelsPath();
49
        $this->handleAppModelsScopesPath();
50
        $this->handleAppNotificationsPath();
51
        $this->handleAppProvidersPath();
52
        $this->handleAppRepositoriesPath();
53
        $this->handleAppRulesPath();
54
        $this->handleAppServicesPath();
55
        $this->handleAppServicesAuthPath();
56
        $this->handleAppTraitsPath();
57
58
        $this->handleConfigPath();
59
60
        $this->handleDatabasePath();
61
62
        $this->handleLangPath();
63
64
        $this->handleRoutesPath();
65
66
        $this->handleTestsPath();
67
68
        $this->handleResourcesPath();
69
70
        $this->callSilently("vendor:publish", ["--provider" => "Laragear\TwoFactor\TwoFactorServiceProvider"]);
71
        $this->components->info("Laragear TwoFactor migration and config file published");
72
73
        $this->callSilently("vendor:publish", ["--provider" => "Spatie\Activitylog\ActivitylogServiceProvider", "--tag" => "activitylog-migrations"]);
74
        $this->components->info("Spatie ActivityLog migration and config file published");
75
76
        $this->callSilently("vendor:publish", ["--provider" => "Spatie\Permission\PermissionServiceProvider"]);
77
        $this->components->info("Spatie Permissions migration and config file published");
78
    }
79
}
80