Completed
Push — master ( 6f8365...5411bf )
by Sergi Tur
01:55
created

PublishAdminLTESidebar   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 69
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 5 1
A publishSidebarView() 0 4 1
A processOptions() 0 4 1
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
use League\Flysystem\Adapter\Local as LocalAdapter;
8
use League\Flysystem\Filesystem as Flysystem;
9
use League\Flysystem\MountManager;
10
11
/**
12
 * Class PublishAdminLTESidebar.
13
 */
14
class PublishAdminLTESidebar extends Command
15
{
16
    use Installable;
17
    
18
    /**
19
     * The filesystem instance.
20
     *
21
     * @var \Illuminate\Filesystem\Filesystem
22
     */
23
    protected $files;
24
25
    /**
26
     * The name and signature of the console command.
27
     */
28
    protected $signature = 'adminlte-laravel:sidebar {--f|force : Force overwrite of files}';
29
30
    /**
31
     * The console command description.
32
     *
33
     * @var string
34
     */
35
    protected $description = 'Publish Acacha adminlte sidebar view in your project allowing you to customize your project sidebar';
36
37
    /**
38
     * Force overwrite of files.
39
     *
40
     * @var bool
41
     */
42
    protected $force = false;
43
44
    /**
45
     * Create a new command instance.
46
     *
47
     * @param \Illuminate\Filesystem\Filesystem $files
48
     *
49
     * @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...
50
     */
51
    public function __construct(Filesystem $files)
52
    {
53
        parent::__construct();
54
        $this->files = $files;
55
    }
56
57
    /**
58
     * Execute the console command.
59
     */
60
    public function handle()
61
    {
62
        $this->processOptions();
63
        $this->publishSidebarView();
64
    }
65
66
67
    /**
68
     * Install views.
69
     */
70
    private function publishSidebarView()
71
    {
72
        $this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::sidebarView());
73
    }
74
   
75
    /**
76
     * Process options before running command.
77
     */
78
    private function processOptions()
79
    {
80
        $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...
81
    }
82
}
83