AclCacheTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 11
ccs 4
cts 5
cp 0.8
rs 10
c 2
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRootKey() 0 2 1
A createCache() 0 3 2
1
<?php
2
namespace Ubiquity\security\acl\cache\traits;
3
4
use Ubiquity\cache\CacheManager;
5
6
/**
7
 * Ubiquity\security\acl\cache\traits$AclCacheTrait
8
 * This class is part of Ubiquity
9
 *
10
 * @author jc
11
 * @version 1.0.0
12
 *
13
 */
14
trait AclCacheTrait {
15
16
	protected static $KEY = 'acls/';
17
18 6
	protected function getRootKey($element) {
19 6
		return self::$KEY . \md5($element);
20
	}
21
22 6
	protected function createCache($part) {
23 6
		if (! CacheManager::$cache->exists($part)) {
24
			CacheManager::$cache->store($part, []);
25
		}
26
	}
27
}
28
29