ListCommand::doExecute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
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