$value, default => throw new AppException(message: 'Valor para cache deve ser string, array ou objeto.', code: 400) }, flags: JSON_UNESCAPED_UNICODE ), ttl: max(-1, $ttl) ); } public static function get(string $key): ?array { $cachedValue = CacheService::get(key: $key); return $cachedValue ? json_decode($cachedValue, true) : null; } public static function delete(array $keys): bool { return CacheService::del(keys: $keys); } }