GitonomyCache::getIncludingBranches()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/**
4
 * Helper class caching expensive gitonomy calls
5
 */
6
class GitonomyCache {
7
	public static $cache = array();
8
9
	public static function getIncludingBranches($commit) {
10
		$cacheKey = 'getIncludingBranches-' . $commit->getRepository()->getPath() . '-' . $commit->gethash();
11
		if(!isset(self::$cache[$cacheKey])) {
12
			self::$cache[$cacheKey] = $commit->getIncludingBranches();
13
		}
14
		return self::$cache[$cacheKey];
15
	}
16
}
17