Completed
Push — master ( 4ad075...9b6fee )
by Vladimir
07:02
created

MakeIntent::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
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
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13 View Code Duplication
class MakeIntent extends Command
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    protected function configure(): void
16
    {
17
        $this
18
            ->setName('make:intent')
19
            ->setDescription('Create a new intent class')
20
            ->addArgument('name', InputArgument::REQUIRED, 'Name of intent');
21
    }
22
23
    protected function execute(InputInterface $input, OutputInterface $output)
24
    {
25
        $name = $input->getArgument('name');
26
27
        /** @var ConversationCreator $creator */
28
        $creator = $this->kernel->resolve(ConversationCreator::class);
29
30
        $creator->createIntent('src', 'App', $name);
31
32
        $output->writeln('<comment>Intent created.</comment>');
33
    }
34
}
35