ListCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 15
rs 10
c 5
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A doExecute() 0 4 1
A configure() 0 4 1
1
<?php
2
3
namespace Startwind\Forrest\CliCommand\Command;
4
5
use Symfony\Component\Console\Command\Command as SymfonyCommand;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class ListCommand extends CommandCommand
11
{
12
    protected static $defaultName = 'commands:list';
13
    protected static $defaultDescription = 'List all command that are registered in the repositories.';
14
15
    protected function configure()
16
    {
17
        parent::configure();
18
        $this->addArgument('repository', InputArgument::OPTIONAL, 'Show only this single repository', '');
19
    }
20
21
    protected function doExecute(InputInterface $input, OutputInterface $output): int
22
    {
23
        $this->renderListCommand($input->getArgument('repository'));
24
        return SymfonyCommand::SUCCESS;
25
    }
26
}
27