Completed
Pull Request — master (#526)
by Michael
02:11
created

Environment::getToolVersion()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
ccs 0
cts 6
cp 0
crap 6
rs 10
1
<?php
2
3
/**
4
 * Class providing information about the tool's runtime environment
5
 */
6
class Environment
7
{
8
	private static $toolVersion;
9
10
	/**
11
	 * Gets the tool version, using cached data if available.
12
	 * @return string
13
	 */
14
	public static function getToolVersion()
15
	{
16
		if (self::$toolVersion == false) {
17
			self::$toolVersion = exec("git describe --always --dirty");
18
		}
19
20
		return self::$toolVersion;
21
	}
22
}
23