Completed
Pull Request — master (#127)
by Matthias
01:24
created

AssessCyclomaticComplexity::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Churn\Commands;
5
6
use Churn\Assessors\CyclomaticComplexity\CyclomaticComplexityAssessor;
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputArgument;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
final class AssessCyclomaticComplexity extends Command
13
{
14
    /**
15
     * Configure the command
16
     * @return void
17
     */
18
    protected function configure()
19
    {
20
        $this->setName('assess-complexity')
21
            ->addArgument('path', InputArgument::REQUIRED, 'Path to source to assess.');
22
    }
23
24
    protected function execute(InputInterface $input, OutputInterface $output)
25
    {
26
        $file = $input->getArgument('path');
27
        $assessor = new CyclomaticComplexityAssessor();
28
        echo $assessor->assess($file);
29
    }
30
}
31