Completed
Push — master ( 9344a2...d77974 )
by Sergi Tur
06:08
created

PublishAdminLTE::publishResourceAssets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 2
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
8
/**
9
 * Class PublishAdminLTE.
10
 */
11
class PublishAdminLTE extends Command
12
{
13
    use Installable;
14
    /**
15
     * The filesystem instance.
16
     *
17
     * @var \Illuminate\Filesystem\Filesystem
18
     */
19
    protected $files;
20
21
    /**
22
     * The name and signature of the console command.
23
     */
24
    protected $signature = 'adminlte-laravel:publish {--f|force : Force overwrite of files}';
25
26
    /**
27
     * The console command description.
28
     *
29
     * @var string
30
     */
31
    protected $description = 'Publish Acacha AdminLTE Template files into laravel project';
32
33
    /**
34
     * Force overwrite of files.
35
     *
36
     * @var bool
37
     */
38
    protected $force = false;
39
40
    /**
41
     * Create a new command instance.
42
     *
43
     * @param \Illuminate\Filesystem\Filesystem $files
44
     *
45
     */
46
    public function __construct(Filesystem $files)
47
    {
48
        parent::__construct();
49
        $this->files = $files;
50
    }
51
52
    /**
53
     * Execute the console command.
54
     */
55 View Code Duplication
    public function handle()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
56
    {
57
        $this->processOptions();
58
59
        //Publish
60
        $this->publishHomeController();
61
        $this->changeRegisterController();
62
        $this->changeLoginController();
63
        $this->changeForgotPasswordController();
64
        $this->changeResetPasswordController();
65
        $this->publishPublicAssets();
66
        $this->publishViews();
67
        $this->publishResourceAssets();
68
        $this->publishTests();
69
        $this->publishLanguages();
70
        $this->publishGravatar();
71
        $this->publishConfig();
72
        $this->publishWebRoutes();
73
        $this->publishApiRoutes();
74
        $this->publishAppServiceProvider();
75
    }
76
77
    /**
78
     * Install Home Controller.
79
     */
80
    private function publishHomeController()
81
    {
82
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::homeController());
83
    }
84
85
    /**
86
     * Change Auth Register controller.
87
     */
88
    private function changeRegisterController()
89
    {
90
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::registerController());
91
    }
92
93
    /**
94
     * Change Auth Login controller.
95
     */
96
    private function changeLoginController()
97
    {
98
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::loginController());
99
    }
100
101
    /**
102
     * Change Auth Forgot Password controller.
103
     */
104
    private function changeForgotPasswordController()
105
    {
106
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::forgotPasswordController());
107
    }
108
109
    /**
110
     * Change Auth Reset Password controller.
111
     */
112
    private function changeResetPasswordController()
113
    {
114
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resetPasswordController());
115
    }
116
117
    /**
118
     * Install public assets.
119
     */
120
    private function publishPublicAssets()
121
    {
122
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::publicAssets());
123
    }
124
125
    /**
126
     * Install views.
127
     */
128
    private function publishViews()
129
    {
130
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::viewsToOverwrite());
131
    }
132
133
    /**
134
     * Install resource assets.
135
     */
136
    private function publishResourceAssets()
137
    {
138
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resourceAssets());
139
    }
140
141
    /**
142
     * Install resource assets.
143
     */
144
    private function publishTests()
145
    {
146
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::tests());
147
    }
148
149
    /**
150
     * Install language assets.
151
     */
152
    private function publishLanguages()
153
    {
154
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::languages());
155
    }
156
157
    /**
158
     * Install gravatar config file.
159
     */
160
    private function publishGravatar()
161
    {
162
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::gravatar());
163
    }
164
165
    /**
166
     * Publish adminlte package config.
167
     */
168
    private function publishConfig()
169
    {
170
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::config());
171
    }
172
173
    /**
174
     * Publish routes/web.php file.
175
     */
176
    private function publishWebRoutes()
177
    {
178
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::webroutes());
179
    }
180
181
    /**
182
     * Publish routes/api.php file.
183
     */
184
    private function publishApiRoutes()
185
    {
186
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::apiroutes());
187
    }
188
189
    /**
190
     * Publish app/Providers/AppServiceProvider.php file.
191
     */
192
    private function publishAppServiceProvider()
193
    {
194
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::appServiceProviderClass());
195
    }
196
197
    /**
198
     * Process options before running command.
199
     */
200
    private function processOptions()
201
    {
202
        $this->force = $this->option('force');
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->option('force') of type string or array is incompatible with the declared type boolean of property $force.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
203
    }
204
}
205