BaseCommand::proceed()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
nc 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