Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed May 12, 2024
1 parent 2694805 commit f16d901
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ protected function set(ResourceObject $object, array $normalization_parts) {
// @todo Investigate whether to cache POST and PATCH requests.
// @todo Follow up on https://www.drupal.org/project/drupal/issues/3381898.
if (!$this->requestStack
->getCurrentRequest()
->isMethodCacheable()) {
return;
->getCurrentRequest()
->isMethodCacheable()) {
return;
}

// Merge the entity's cacheability metadata with that of the normalization
// parts, so that VariationCache can take care of cache redirects for us.
// Merge the entity's cacheability metadata with that of the normalization
// parts, so that VariationCache can take care of cache redirects for us.
$cacheability = CacheableMetadata::createFromObject($object)
// Adds url.query_args:site to the normalization.
->addCacheContexts(['url.query_args:site'])
->merge(static::mergeCacheableDependencies($normalization_parts[static::RESOURCE_CACHE_SUBSET_BASE]))
->merge(static::mergeCacheableDependencies($normalization_parts[static::RESOURCE_CACHE_SUBSET_FIELDS]));
$this->variationCache
->set($this->generateCacheKeys($object), $normalization_parts, $cacheability, new CacheableMetadata());
->set($this->generateCacheKeys($object), $normalization_parts, $cacheability, new CacheableMetadata());
}

/**
Expand All @@ -53,10 +53,10 @@ protected function set(ResourceObject $object, array $normalization_parts) {
protected static function generateCacheKeys(ResourceObject $object) {
return [
$object->getResourceType()
->getTypeName(),
->getTypeName(),
$object->getId(),
$object->getLanguage()
->getId(),
->getId(),
];
}

Expand Down

0 comments on commit f16d901

Please sign in to comment.