Completed
Push — master ( bc6c17...74b7ca )
by Sergi Tur
11s
created

AdminLTE   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 5
Bugs 0 Features 3
Metric Value
wmc 8
c 5
b 0
f 3
lcom 1
cbo 1
dl 0
loc 80
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 1
A installHomeController() 0 4 1
A installAuthController() 0 4 1
A installPublicAssets() 0 4 1
A installViews() 0 4 1
A installResourceAssets() 0 4 1
A install() 0 6 2
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console;
4
5
use Illuminate\Console\Command;
6
7
/**
8
 * Class AdminLTE.
9
 */
10
class AdminLTE extends Command
11
{
12
    /**
13
     * The name and signature of the console command.
14
     */
15
    protected $signature = 'adminlte-laravel:install';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Install Acacha AdminLTE Template into fresh laravel project';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     */
29
    public function handle()
30
    {
31
        $this->installHomeController();
32
        $this->installAuthController();
33
        $this->installPublicAssets();
34
        $this->installViews();
35
        $this->installResourceAssets();
36
    }
37
38
    /**
39
     * Install Home Controller.
40
     */
41
    private function installHomeController()
42
    {
43
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::homeController());
44
    }
45
46
    /**
47
     * Install Auth controller.
48
     */
49
    private function installAuthController()
50
    {
51
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::authController());
52
    }
53
54
    /**
55
     * Install public assets.
56
     */
57
    private function installPublicAssets()
58
    {
59
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::publicAssets());
60
    }
61
62
    /**
63
     * Install views.
64
     */
65
    private function installViews()
66
    {
67
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::views());
68
    }
69
70
    /**
71
     * Install resource assets.
72
     */
73
    private function installResourceAssets()
74
    {
75
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resourceAssets());
76
    }
77
78
    /**
79
     * Install files from array.
80
     *
81
     * @param $files
82
     */
83
    private function install($files)
84
    {
85
        foreach ($files as $fileSrc => $fileDst) {
86
            copy($fileSrc, $fileDst);
87
        }
88
    }
89
}
90