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

MigrationsVersion   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 26
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0

2 Methods

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