Completed
Push — search ( 076ba7...2a5267 )
by Simon
16:36 queued 11:48
created

Environment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 18
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getToolVersion() 0 7 2
1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 *                                                                            *
5
 * All code in this file is released into the public domain by the ACC        *
6
 * Development Team. Please see team.json for a list of contributors.         *
7
 ******************************************************************************/
8
9
namespace Waca;
10
11
/**
12
 * Class providing information about the tool's runtime environment
13
 */
14
class Environment
15
{
16
    /**
17
     * @var string Cached copy of the tool version
18
     */
19
    private static $toolVersion = null;
20
21
    /**
22
     * Gets the tool version, using cached data if available.
23
     * @return string
24
     */
25 1
    public static function getToolVersion()
26
    {
27 1
        if (self::$toolVersion === null) {
0 ignored issues
show
introduced by
The condition self::toolVersion === null is always false.
Loading history...
28 1
            self::$toolVersion = exec("git describe --always --dirty");
29
        }
30
31 1
        return self::$toolVersion;
32
    }
33
}
34