Completed
Push — master ( 830b0b...832bbc )
by Vladimir
02:55
created

MakeIntent::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 11
ccs 6
cts 6
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Toolbelt\Commands;
6
7
use FondBot\Toolbelt\Command;
8
use FondBot\Conversation\ConversationCreator;
9
use Symfony\Component\Console\Input\InputArgument;
10
11
class MakeIntent extends Command
12
{
13 2
    protected function configure(): void
14
    {
15
        $this
16 2
            ->setName('make:intent')
17 2
            ->setDescription('Create a new intent class')
18 2
            ->addArgument('name', InputArgument::REQUIRED, 'Name of intent');
19 2
    }
20
21 1
    public function handle(): void
22
    {
23 1
        $name = $this->getArgument('name');
24
25
        /** @var ConversationCreator $creator */
26 1
        $creator = resolve(ConversationCreator::class);
27
28 1
        $creator->createIntent('src', 'App', $name);
29
30 1
        $this->success('Intent created.');
31 1
    }
32
}
33