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

MakeIntent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A handle() 0 11 1
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