Passed
Push — master ( 5ba0c7...1a52dc )
by Oliver
01:34
created

CoversValidator::getDefaultCommands()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace OckCyp\CoversValidator\Application;
4
5
use Composer\InstalledVersions;
6
use function class_alias;
7
use function version_compare;
8
9
$isSymfony6 = version_compare(
10
    InstalledVersions::getVersion('symfony/console'),
0 ignored issues
show
Bug introduced by
It seems like Composer\InstalledVersio...sion('symfony/console') can also be of type null; however, parameter $version1 of version_compare() 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

10
    /** @scrutinizer ignore-type */ InstalledVersions::getVersion('symfony/console'),
Loading history...
11
    '6.0.0'
12
) >= 0;
13
14
class_alias(
15
    $isSymfony6 ? CoversValidatorSymfony6::class : CoversValidatorSymfony5::class,
16
    'OckCyp\CoversValidator\Application\CoversValidator'
17
);
18