diff --git a/src/CacheItemSelector/AbstractRequestBuilder.php b/src/CacheItemSelector/AbstractRequestBuilder.php index 5099152..9ae4702 100644 --- a/src/CacheItemSelector/AbstractRequestBuilder.php +++ b/src/CacheItemSelector/AbstractRequestBuilder.php @@ -55,7 +55,7 @@ public function withCookies(array $cookies): self public function withHeaders(array $headers): self { $this->server = collect($this->server) - ->filter(fn(string $val, string $key) => !str_starts_with($key, 'HTTP_')) + ->filter(fn (string $val, string $key) => ! str_starts_with($key, 'HTTP_')) ->merge(collect($headers) ->mapWithKeys(function (string $val, string $key) { return ['HTTP_' . str_replace('-', '_', Str::upper($key)) => $val]; @@ -92,7 +92,7 @@ protected function build(string $uri): Request if (isset($this->cacheNameSuffix)) { $request->attributes->add([ - 'responsecache.cacheNameSuffix' => $this->cacheNameSuffix + 'responsecache.cacheNameSuffix' => $this->cacheNameSuffix, ]); } diff --git a/src/CacheItemSelector/CacheItemSelector.php b/src/CacheItemSelector/CacheItemSelector.php index 85c3c57..514f3ba 100644 --- a/src/CacheItemSelector/CacheItemSelector.php +++ b/src/CacheItemSelector/CacheItemSelector.php @@ -14,18 +14,17 @@ class CacheItemSelector extends AbstractRequestBuilder public function __construct( protected RequestHasher $hasher, protected ResponseCacheRepository $cache, - ) - { + ) { } - public function usingTags(string|array $tags): static + public function usingTags(string | array $tags): static { $this->tags = is_array($tags) ? $tags : func_get_args(); return $this; } - public function forUrls(string|array $urls): static + public function forUrls(string | array $urls): static { $this->urls = is_array($urls) ? $urls : func_get_args(); @@ -40,8 +39,8 @@ public function forget(): void return $this->hasher->getHashFor($request); }) - ->filter(fn($hash) => $this->taggedCache($this->tags)->has($hash)) - ->each(fn($hash) => $this->taggedCache($this->tags)->forget($hash)); + ->filter(fn ($hash) => $this->taggedCache($this->tags)->has($hash)) + ->each(fn ($hash) => $this->taggedCache($this->tags)->forget($hash)); } protected function taggedCache(array $tags = []): ResponseCacheRepository