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

CoversValidator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 4
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