ListHistoryAnalysersCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * Static Analysis Results Baseliner (sarb).
5
 *
6
 * (c) Dave Liddament
7
 *
8
 * For the full copyright and licence information please view the LICENSE file distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Framework\Command;
14
15
use DaveLiddament\StaticAnalysisResultsBaseliner\Framework\Container\HistoryFactoryRegistry;
16
use Symfony\Component\Console\Command\Command;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Output\OutputInterface;
19
20
final class ListHistoryAnalysersCommand extends Command
21
{
22
    public const COMMAND_NAME = 'list-history-analysers';
23
24
    /**
25
     * @var string|null
26
     */
27
    protected static $defaultName = self::COMMAND_NAME;
28
29
    /**
30
     * Constructor.
31
     */
32
    public function __construct(
33
        private HistoryFactoryRegistry $historyFactoryRegistry,
34
    ) {
35
        parent::__construct(self::COMMAND_NAME);
36
    }
37
38
    protected function execute(InputInterface $input, OutputInterface $output): int
39
    {
40
        foreach ($this->historyFactoryRegistry->getIdentifiers() as $identifier) {
41
            $output->writeln($identifier);
42
        }
43
44
        return 0;
45
    }
46
}
47