|
11 | 11 | use Fetch\Cache\MemoryCache; |
12 | 12 | use Fetch\Http\Response; |
13 | 13 | use Fetch\Interfaces\ClientHandler; |
| 14 | +use Fetch\Interfaces\Response as ResponseInterface; |
14 | 15 |
|
15 | 16 | /** |
16 | 17 | * Trait for managing HTTP caching. |
@@ -188,7 +189,7 @@ protected function getCachedResponse(string $method, string $uri, array $options |
188 | 189 | * |
189 | 190 | * @param array<string, mixed> $options Request options |
190 | 191 | */ |
191 | | - protected function cacheResponse(string $method, string $uri, Response $response, array $options = []): void |
| 192 | + protected function cacheResponse(string $method, string $uri, ResponseInterface $response, array $options = []): void |
192 | 193 | { |
193 | 194 | if ($this->cache === null || ! $this->isCacheableMethod($method)) { |
194 | 195 | return; |
@@ -225,7 +226,7 @@ protected function cacheResponse(string $method, string $uri, Response $response |
225 | 226 | * |
226 | 227 | * @param array<string, mixed> $options Request options |
227 | 228 | */ |
228 | | - protected function calculateTtl(Response $response, CacheControl $cacheControl, array $options = []): ?int |
| 229 | + protected function calculateTtl(ResponseInterface $response, CacheControl $cacheControl, array $options = []): ?int |
229 | 230 | { |
230 | 231 | // Check for per-request TTL |
231 | 232 | $cacheConfig = $options['cache'] ?? []; |
@@ -280,7 +281,7 @@ protected function addConditionalHeaders(array $options, ?CachedResponse $cached |
280 | 281 | /** |
281 | 282 | * Handle a 304 Not Modified response. |
282 | 283 | */ |
283 | | - protected function handleNotModified(CachedResponse $cached, Response $response): Response |
| 284 | + protected function handleNotModified(CachedResponse $cached, ResponseInterface $response): Response |
284 | 285 | { |
285 | 286 | // Create a new response with the cached body but potentially updated headers |
286 | 287 | $headers = $cached->getHeaders(); |
|
0 commit comments