Files
onboard/app/Services/Cache/CacheKeyBuilder.php
2026-04-24 16:46:10 +09:00

18 lines
397 B
PHP

<?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}";
}
}