Skip to content

Commit

Permalink
Add getSupportedTypes()
Browse files Browse the repository at this point in the history
  • Loading branch information
alaugks committed Nov 12, 2024
1 parent 79d3960 commit c8d95fa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/src/Normalizer/MappingTableNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Webmozart\Assert\Assert;

use function get_class;

class MappingTableNormalizer implements NormalizerInterface, DenormalizerInterface
{
public const TABLE = 'mapping_table';
Expand All @@ -26,7 +24,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return ''; // Reset value from property in Emarsys CRM
}

Assert::keyExists($context, self::TABLE, sprintf('MappingTable not set (%s)', get_class($object)));
Assert::keyExists($context, self::TABLE, sprintf('MappingTable not set (%s)', \get_class($object)));

$key = array_search($object->getValue(), $context[self::TABLE], true);
return $key ? (string)$key : null;
Expand All @@ -49,4 +47,11 @@ public function supportsDenormalization($data, $type, $format = null): bool
{
return in_array($type, self::SUPPORTED_TYPES);
}

public function getSupportedTypes(?string $format): array
{
return [
'*' => false
];
}
}

0 comments on commit c8d95fa

Please sign in to comment.