autumndev/jms-serializer-carbon

Carbon Serialization or JSM Serializer

Installs: 75 008

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 7

Open Issues: 2

pkg:composer/autumndev/jms-serializer-carbon

v3.3 2024-03-28 10:07 UTC

This package is auto-updated.

Last update: 2025-09-28 13:52:30 UTC


README

Carbon Serializer for the JMS Serializer library

Installation

To instal and use the package please install as per the JMS documentation:

$builder
    ->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) {
        $registry->registerSubscribingHandler(new \AutumnDev\JMS\CarbonHandler());
    })
;

Symfony2

You will need to register a new service in order to utilise the Carbon serilisation:

carbon_handler:
        class: AutumnDev\JMS\CarbonHandler
        tags:
            - { name: jms_serializer.subscribing_handler }

Usage

In order to use the serialisation you must tag your entities thusly:

    /**
    * @Type("Carbon")
    */
    public $date;