AddRouteConfigsToRouteFilesCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 1
A configure() 0 3 1
A __construct() 0 6 1
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