MakeRequestCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 14
rs 10
1
<?php
2
3
namespace MojtabaGheytasi\RequestValidatorBundle\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Symfony\Component\Console\Style\SymfonyStyle;
9
10
class MakeRequestCommand extends Command
11
{
12
    protected static $defaultName = 'make:request';
13
14
    protected function execute(InputInterface $input, OutputInterface $output): int
15
    {
16
        (new SymfonyStyle($input, $output))
17
            ->error(
18
                sprintf(
19
                    "To run \"%s\" you need the \"%s\" which is currently not installed.\n\nTry running \"composer require %s\".",
20
                    static::$defaultName,
21
                    'MakerBundle',
22
                    'symfony/maker-bundle --dev'
23
                )
24
            )
25
        ;
26
27
        return Command::SUCCESS;
28
    }
29
}
30