ModuleInstallCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
namespace Epesi\Core\Console;
4
5
use Illuminate\Console\Command;
6
use Epesi\Core\System\Modules\ModuleManager;
7
8
class ModuleInstallCommand extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'epesi:module-install {module : The class name or alias of the module.}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Install the epesi module';
23
24
    /**
25
     * Execute the console command.
26
     */
27
    public function handle()
28
    {
29
    	try {
30
    		ob_start();
31
    		ModuleManager::install($this->argument('module'));
0 ignored issues
show
Bug introduced by
It seems like $this->argument('module') can also be of type null and string[]; however, parameter $classOrAlias of Epesi\Core\System\Modules\ModuleManager::install() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
    		ModuleManager::install(/** @scrutinizer ignore-type */ $this->argument('module'));
Loading history...
32
    		
33
    		$this->alert(ob_get_clean());
34
    	} catch (\Exception $e) {
35
    		$this->error($e->getMessage());
36
    	}
37
    }
38
    
39
}
40