Test Failed
Push — main ( 573841...5a0b4f )
by Jean-Christophe
06:17
created

AclCacheTrait::getRootKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

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
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 const KEY = 'acls/';
17
18
	protected function getRootKey($element) {
19
		return self::KEY . \md5($element);
0 ignored issues
show
Bug introduced by
The constant Ubiquity\security\acl\ca...aits\AclCacheTrait::KEY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
20
	}
21
22
	protected function createCache($part) {
23
		if (! CacheManager::$cache->exists($part)) {
24
			CacheManager::$cache->store($part, []);
25
		}
26
	}
27
}
28
29