BaseCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 2
proceed() 0 1 ?
1
<?php
2
3
namespace Mnabialek\LaravelModular\Console\Commands;
4
5
use Exception;
6
use Illuminate\Console\Command;
7
use Mnabialek\LaravelModular\Console\Traits\ModuleCreator;
8
9
abstract class BaseCommand extends Command
10
{
11
    use ModuleCreator;
12
13
    /**
14
     * Run commands
15
     */
16
    public function handle()
17
    {
18
        try {
19
            // verify whether module config file exists
20
            $this->verifyConfigExistence();
21
22
            $this->proceed();
23
        } catch (Exception $e) {
24
            $this->error($e->getMessage());
25
        }
26
    }
27
28
    /**
29
     * Main command function that launches all the logic
30
     */
31
    abstract protected function proceed();
32
}
33