Completed
Push — master ( fc3d6f...f7b1d9 )
by Sergi Tur
28:05
created

src/Console/PublishAdminLTESidebar.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
8
/**
9
 * Class PublishAdminLTESidebar.
10
 */
11
class PublishAdminLTESidebar extends Command
12
{
13
    use Installable;
14
15
    /**
16
     * The filesystem instance.
17
     *
18
     * @var \Illuminate\Filesystem\Filesystem
19
     */
20
    protected $files;
21
22
    /**
23
     * The name and signature of the console command.
24
     */
25
    protected $signature = 'adminlte-laravel:sidebar {--f|force : Force overwrite of files}';
26
27
    /**
28
     * The console command description.
29
     *
30
     * @var string
31
     */
32
    protected $description =
33
        'Publish Acacha adminlte sidebar view in your project allowing you to customize your project sidebar';
34
35
    /**
36
     * Force overwrite of files.
37
     *
38
     * @var bool
39
     */
40
    protected $force = false;
41
42
    /**
43
     * Create a new command instance.
44
     *
45
     * @param \Illuminate\Filesystem\Filesystem $files
46
     *
47
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
48
     */
49
    public function __construct(Filesystem $files)
50
    {
51
        parent::__construct();
52
        $this->files = $files;
53
    }
54
55
    /**
56
     * Execute the console command.
57
     */
58
    public function handle()
59
    {
60
        $this->processOptions();
61
        $this->publishSidebarView();
62
    }
63
64
    /**
65
     * Install views.
66
     */
67
    private function publishSidebarView()
68
    {
69
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::sidebarView());
70
    }
71
72
    /**
73
     * Process options before running command.
74
     */
75
    private function processOptions()
76
    {
77
        $this->force = $this->option('force');
78
    }
79
}
80