Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class UserNotFoundCache |
||
11 | { |
||
12 | private const PREFIX = 'not_found_'; |
||
13 | private const TTL = 86400; |
||
14 | |||
15 | /** |
||
16 | * @param string $usernameOrUuid |
||
17 | * |
||
18 | * @return bool |
||
19 | */ |
||
20 | public static function has(string $usernameOrUuid): bool |
||
21 | { |
||
22 | if (Cache::has(self::PREFIX.\md5($usernameOrUuid))) { |
||
23 | Log::debug('User not found cache hit: '.$usernameOrUuid); |
||
24 | |||
25 | return true; |
||
26 | } |
||
27 | |||
28 | return false; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param $usernameOrUuid |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public static function add($usernameOrUuid): bool |
||
39 | } |
||
40 | } |
||
41 |