Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (23 loc) · 875 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 875 Bytes

Event Store Component

Serializer component provides serializers to your application.

The component provides a simple serializer interface and a serializer implementation based on "handwritten" serializers.

The available adapters are:

  • JMS Serializer
  • Symfony Serializer
  • PHP Serializer

Usage

use JMS\Serializer\Handler\HandlerRegistry;
use JMS\Serializer\SerializerBuilder;
use HelloFresh\Engine\Serializer\Adapter\JmsSerializerAdapter;

$jmsSerializer = SerializerBuilder::create()
    ->setMetadataDirs(['' => __DIR__ . '/metadata'])
    ->configureHandlers(function (HandlerRegistry $registry) {
        $registry->registerSubscribingHandler(new VectorHandler());
        $registry->registerSubscribingHandler(new UuidSerializerHandler());
    })
    ->addDefaultHandlers()
    ->build();

$serializer = new JmsSerializerAdapter($jmsSerializer);