AclCacheTrait::getRootKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
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