rosamarsky/jms-carbon-handler

Simple to use Carbon handler for the JMS Serializer

Installs: 63 986

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/rosamarsky/jms-carbon-handler

2.0 2018-10-12 22:48 UTC

This package is auto-updated.

Last update: 2025-10-27 11:59:25 UTC


README

Simple to use Carbon handler for JMS Serializer

Installation

composer require rosamarsky/jms-carbon-handler

Setup

Register the Carbon Handler via the builder object:

    $builder->configureHandlers(function (HandlerRegistry $registry) {
        $registry->registerSubscribingHandler(new CarbonHandler);
    });

Usage

As annotations:

    class SomeClass
    {
        /**
         * @Type("Carbon<'Y-m-d'>")
         */
        public $date;
    }

As YAML:

    date:
      type: Carbon<'d-m-Y'>

As XML:

    <property name="date" xml-attribute="true" type="Carbon"/>