From 83ea88bfb8768290d7cd7602c0dcbbddf8b9bdd4 Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:48:49 +0100 Subject: [PATCH] Fix composer dependencies and not used code --- composer.json | 1 + src/Serializer/AssetNormalizer.php | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 23e7c861b..5d7628a8b 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "php": "~8.1.0 || ~8.2.0", "pimcore/enterprise-subscription-tools": "^1.3", "pimcore/static-resolver-bundle": "^1.0", + "pimcore/generic-data-index-bundle": "^1.0", "pimcore/pimcore": "^11.0", "api-platform/core": "^3.2" }, diff --git a/src/Serializer/AssetNormalizer.php b/src/Serializer/AssetNormalizer.php index 2b27b8c74..ced9ed95f 100644 --- a/src/Serializer/AssetNormalizer.php +++ b/src/Serializer/AssetNormalizer.php @@ -14,7 +14,6 @@ namespace Pimcore\Bundle\StudioApiBundle\Serializer; use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -25,10 +24,6 @@ final class AssetNormalizer implements NormalizerInterface, NormalizerAwareInter private const ALREADY_CALLED = 'ASSET_NORMALIZER_ALREADY_CALLED'; - public function __construct(private readonly RequestStack $requestStack) - { - } - public function normalize($object, $format = null, array $context = []): array { $context[self::ALREADY_CALLED] = true; @@ -49,11 +44,11 @@ public function normalize($object, $format = null, array $context = []): array public function supportsNormalization($data, $format = null, array $context = []): bool { return false; - if (isset($context[self::ALREADY_CALLED])) { + /*if (isset($context[self::ALREADY_CALLED])) { return false; } - return $data instanceof Asset; + return $data instanceof Asset;*/ } public function getSupportedTypes(?string $format): array