BaseLineFileHelper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBaselineFile() 0 3 1
A configureBaseLineFileArgument() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Framework\Command\internal;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\BaseLineFileName;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputArgument;
10
use Symfony\Component\Console\Input\InputInterface;
11
12
final class BaseLineFileHelper
13
{
14
    private const BASELINE_FILE = 'baseline-file';
15
16
    public static function configureBaseLineFileArgument(Command $command): void
17
    {
18
        $command->addArgument(
19
            self::BASELINE_FILE,
20
            InputArgument::REQUIRED, 'Baseline file',
21
        );
22
    }
23
24
    /**
25
     * @throws InvalidConfigException
26
     */
27
    public static function getBaselineFile(InputInterface $input): BaseLineFileName
28
    {
29
        return new BaseLineFileName(CliConfigReader::getArgument($input, self::BASELINE_FILE));
30
    }
31
}
32