Failed Conditions
Pull Request — master (#632)
by Michael
02:44
created

MigrationsVersion::VERSION()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 9
ccs 4
cts 5
cp 0.8
crap 2.032
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations;
6
7
class MigrationsVersion
8
{
9
    /** @var string */
10
    private static $version = 'v2.0.0';
11
12 9
    public static function VERSION() : string
13
    {
14 9
        $gitVersion = '@git-version@';
15
16 9
        if (self::isACustomPharBuild($gitVersion)) {
17
            return $gitVersion;
18
        }
19
20 9
        return self::$version;
21
    }
22
23 10
    private static function isACustomPharBuild(string $gitVersion) : bool
24
    {
25 10
        return $gitVersion !== '@' . 'git-version@';
26
    }
27
}
28