AddRouteConfigsToRouteFilesCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Bugloos\ApiVersioningBundle\Command;
4
5
use Bugloos\ApiVersioningBundle\Service\ApiVersioningHandler;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class AddRouteConfigsToRouteFilesCommand extends Command
11
{
12
    protected static $defaultName = 'api-versioning:generate-route-configs';
13
14
    private ApiVersioningHandler $apiVersioningHandler;
15
16
    public function __construct(
17
        ApiVersioningHandler $apiVersioningHandler,
18
        string $name = null
19
    ) {
20
        parent::__construct($name);
21
        $this->apiVersioningHandler = $apiVersioningHandler;
22
    }
23
24
    protected function configure(): void
25
    {
26
        $this->setDescription('Generate route configs');
27
    }
28
29
    /**
30
     * @param InputInterface $input
31
     * @param OutputInterface $output
32
     *
33
     * @return int
34
     */
35
    protected function execute(InputInterface $input, OutputInterface $output): int
36
    {
37
        $this->apiVersioningHandler->generateRouteFiles();
38
39
        return 0;
40
    }
41
}
42