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

MigrationsVersion   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A VERSION() 0 9 2
A isACustomPharBuild() 0 3 1
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