From 6225673273203c53b0ae57bbb00c67673232cd98 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Mon, 16 Dec 2024 09:15:51 +0100 Subject: [PATCH] Fix incorrect variable naming in IconNormalizer Replaced instances of `$object` with `$data` in the normalize method to match the method's parameter declaration. Ensures consistency and correct type handling during normalization. --- src/Normalizer/IconNormalizer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Normalizer/IconNormalizer.php b/src/Normalizer/IconNormalizer.php index 3d39bc9..1043f31 100644 --- a/src/Normalizer/IconNormalizer.php +++ b/src/Normalizer/IconNormalizer.php @@ -25,13 +25,13 @@ public function __construct( */ public function normalize(mixed $data, ?string $format = null, array $context = []): array { - assert($object instanceof Icon); - $icon = $this->iconResolver->getIcon($object); - $imageType = $this->iconResolver->getType($object->type, $icon->url); + assert($data instanceof Icon); + $icon = $this->iconResolver->getIcon($data); + $imageType = $this->iconResolver->getType($data->type, $icon->url); $result = [ 'src' => $icon->url, - 'sizes' => $object->getSizeList(), + 'sizes' => $data->getSizeList(), 'type' => $imageType, 'purpose' => $data->purpose, ];