1]) * => "students:list:page:1" * * CacheKey::build('students', 'list', ['status' => 'active', 'page' => 2]) * => "students:list:page:2:status:active" (sorted by key) * * CacheKey::build('students', 'detail', ['id' => 15]) * => "students:detail:id:15" */ public static function build(string $module, string $type, array $params = []): string { ksort($params); $parts = [$module, $type]; foreach ($params as $param => $value) { $parts[] = (string) $param; $parts[] = is_array($value) ? implode(',', $value) : (string) $value; } return implode(':', $parts); } }