Докинул к 719eb1403f
This commit is contained in:
17
app/Services/Cache/CacheKeyBuilder.php
Normal file
17
app/Services/Cache/CacheKeyBuilder.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cache;
|
||||
|
||||
class CacheKeyBuilder
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $version = 'v1'
|
||||
) {}
|
||||
|
||||
public function make(string $key, array $parts = []): string
|
||||
{
|
||||
$suffix = empty($parts) ? '' : ':' . implode(':', array_map(static fn ($part) => (string) $part, $parts));
|
||||
|
||||
return "{$this->version}:{$key}{$suffix}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user