AclCacheTrait::createCache()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2.1481

Importance

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