Completed
Push — master ( 882947...a4a53d )
by Mike
13:52 queued 13:46
created

MigrationsVersion::isACustomPharBuild()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Doctrine\DBAL\Migrations;
4
5
class MigrationsVersion
6
{
7
    private static $version = 'v1.5.0';
8
9 9
    public static function VERSION()
10
    {
11 9
        $gitversion = '@git-version@';
12
13 9
        if (self::isACustomPharBuild($gitversion)) {
14
            return $gitversion;
15
        }
16 9
        return self::$version;
17
    }
18
19
    /**
20
     * @param $gitversion
21
     * @return bool
22
     *
23
     * Check if doctrine migration is installed by composer or
24
     * in a modified (not tagged) phar version.
25
     */
26 10
    private static function isACustomPharBuild($gitversion)
27
    {
28 10
        return $gitversion !== '@' . 'git-version@';
29
    }
30
}
31