Test Failed
Push — main ( 6d127d...41f629 )
by mikhail
13:20
created

AnalyzeFilesCommand::getProjectRoot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SavinMikhail\CommentsDensity\Commands;
6
7
use SavinMikhail\CommentsDensity\Reporters\ConsoleReporter;
0 ignored issues
show
Bug introduced by
The type SavinMikhail\CommentsDen...porters\ConsoleReporter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\Console\Input\InputArgument;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class AnalyzeFilesCommand extends Command
13
{
14
    protected function configure(): void
15
    {
16
        $this->setName('analyze:files')
17
            ->setDescription('Analyzes the comment density in multiple PHP files.')
18
            ->addArgument('files', InputArgument::IS_ARRAY, 'The PHP files to analyze')
19
            ->setHelp('This command allows you to analyze the comments in multiple PHP files.');
20
    }
21
22
    /**
23
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
24
     */
25
    protected function execute(InputInterface $input, OutputInterface $output): int
26
    {
27 2
        $configDto = $this->getConfigDto();
28
29 2
        $files = $input->getArgument('files');
30 2
        $reporter = new ConsoleReporter($output);
31 2
32 2
        $analyzer = $this->getAnalyzer($configDto, $output, $reporter);
33
34
        return $this->analyze($analyzer, $files, $output);
35
    }
36
}
37