Skip to content

Commit b7ee828

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: Update custom_normalizer.rst
2 parents 8ddf851 + a9e1e5a commit b7ee828

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

serializer/custom_normalizer.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ normalization process::
3838

3939
public function normalize(mixed $data, ?string $format = null, array $context = []): array
4040
{
41-
$data = $this->normalizer->normalize($data, $format, $context);
41+
$normalizedData = $this->normalizer->normalize($data, $format, $context);
4242

4343
// Here, add, edit, or delete some data:
44-
$data['href']['self'] = $this->router->generate('topic_show', [
45-
'id' => $object->getId(),
44+
$normalizedData['href']['self'] = $this->router->generate('topic_show', [
45+
'id' => $data->getId(),
4646
], UrlGeneratorInterface::ABSOLUTE_URL);
4747

48-
return $data;
48+
return $normalizedData;
4949
}
5050

5151
public function supportsNormalization($data, ?string $format = null, array $context = []): bool

0 commit comments

Comments
 (0)