CacheKeyGenerator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 12
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A generate() 0 3 1
1
<?php
2
3
namespace Blackmine\Client\Generator;
4
5
class CacheKeyGenerator implements KeyGeneratorInterface
6
{
7
8
    protected const KEY_SEPARATOR = "";
9
10
    public function __construct(protected string $seed)
11
    {
12
    }
13
14
    public function generate(...$params): string
15
    {
16
        return strtoupper(sha1($this->seed . implode(static::KEY_SEPARATOR, $params)));
17
    }
18
}
19