MakeCommand::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GarbuzIvan\LaravelGeneratorPackage\Commands;
6
7
use GarbuzIvan\LaravelGeneratorPackage\Builder\Builder;
8
use Illuminate\Console\Command;
9
use Illuminate\Support\Composer;
10
11
class MakeCommand extends Command
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'lgp:make {package?}';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Generator the composer package from config file laravel-generator-package';
26
27
    /**
28
     * The console command signature.
29
     *
30
     * @var string
31
     */
32
    protected $signature = 'lgp:make {package?}';
33
34
    /**
35
     * @var Composer
36
     */
37
    public Composer $composer;
38
39
    /**
40
     * Create a new command instance.
41
     */
42 2
    public function __construct()
43
    {
44 2
        parent::__construct();
45 2
    }
46
47
    /**
48
     * Execute the command.
49
     *
50
     * @return mixed
51
     */
52 2
    public function handle()
53
    {
54 2
        $arguments = $this->arguments();
55 2
        $this->line('Start composer package generation');
56 2
        app(Builder::class)->init($arguments['package']);
57 2
        $this->line('Stop generation');
58 2
        return 1;
59
    }
60
}
61