Skip to content

Commit 4daf0d9

Browse files
committed
Merge 2.7 into 3.0
2 parents 511e48e + c1fb7db commit 4daf0d9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Hal/Serializer/ItemNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ public function normalize(mixed $object, string $format = null, array $context =
5656
return parent::normalize($object, $format, $context);
5757
}
5858

59-
if (!isset($context['cache_key'])) {
60-
$context['cache_key'] = $this->getCacheKey($format, $context);
61-
}
62-
6359
if ($this->resourceClassResolver->isResourceClass($resourceClass)) {
6460
$resourceClass = $this->resourceClassResolver->getResourceClass($object, $context['resource_class'] ?? null);
6561
}
@@ -69,6 +65,10 @@ public function normalize(mixed $object, string $format = null, array $context =
6965
$context['iri'] = $iri;
7066
$context['api_normalize'] = true;
7167

68+
if (!isset($context['cache_key'])) {
69+
$context['cache_key'] = $this->getCacheKey($format, $context);
70+
}
71+
7272
$data = parent::normalize($object, $format, $context);
7373
if (!\is_array($data)) {
7474
return $data;

src/JsonApi/Serializer/ItemNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ public function normalize(mixed $object, string $format = null, array $context =
7575
return parent::normalize($object, $format, $context);
7676
}
7777

78-
if (!isset($context['cache_key'])) {
79-
$context['cache_key'] = $this->getCacheKey($format, $context);
80-
}
81-
8278
if ($this->resourceClassResolver->isResourceClass($resourceClass)) {
8379
$resourceClass = $this->resourceClassResolver->getResourceClass($object, $context['resource_class'] ?? null);
8480
}
@@ -92,6 +88,10 @@ public function normalize(mixed $object, string $format = null, array $context =
9288
$context['iri'] = $iri;
9389
$context['api_normalize'] = true;
9490

91+
if (!isset($context['cache_key'])) {
92+
$context['cache_key'] = $this->getCacheKey($format, $context);
93+
}
94+
9595
$data = parent::normalize($object, $format, $context);
9696
if (!\is_array($data)) {
9797
return $data;

0 commit comments

Comments
 (0)