Skip to content

Commit

Permalink
feat: upgrade serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
rem42 committed Feb 20, 2024
1 parent 81915ae commit 71d8fa4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Factory/SerializerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Scraper\ScraperPrestashop\Factory;

use Doctrine\Common\Annotations\AnnotationReader;
use Scraper\ScraperPrestashop\Normalizer\PrestashopDeliveryPointNormalizer;
use Scraper\ScraperPrestashop\Normalizer\PrestashopItemNormalizer;
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter;
use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
Expand All @@ -22,7 +21,7 @@ class SerializerFactory
{
public static function create(): Serializer
{
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());

$metadataAwareNameConverter = new MetadataAwareNameConverter($classMetadataFactory, new CamelCaseToSnakeCaseNameConverter());

Expand Down

0 comments on commit 71d8fa4

Please sign in to comment.