Application::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace ComposerRequireChecker\Cli;
4
5
use PackageVersions\Versions;
6
use Symfony\Component\Console\Application as AbstractApplication;
7
8
class Application extends AbstractApplication
9
{
10 10
    public function __construct()
11
    {
12 10
        parent::__construct(
13 10
            'ComposerRequireChecker',
14 10
            Versions::getVersion('maglnet/composer-require-checker')
15
        );
16
17 10
        $check = new CheckCommand();
18 10
        $this->add($check);
19 10
        $this->setDefaultCommand($check->getName());
0 ignored issues
show
Bug introduced by
It seems like $check->getName() can also be of type null; however, parameter $commandName of Symfony\Component\Consol...on::setDefaultCommand() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
        $this->setDefaultCommand(/** @scrutinizer ignore-type */ $check->getName());
Loading history...
20 10
    }
21
}
22