2017 © Pedro Peláez
 

library jms-serializer-uuid

Uuid serializer and deserializer for JMS Serializer library

image

mhujer/jms-serializer-uuid

Uuid serializer and deserializer for JMS Serializer library

  • Sunday, January 7, 2018
  • by mhujer
  • Repository
  • 2 Watchers
  • 8 Stars
  • 43,914 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 18 % Grown

The README.md

UUID support for JMS Serializer

Latest Stable Version Total Downloads License Coverage Status, (*1)

This library allows you to serialize and deserialize ramsey/uuid UUIDs when using JMS Serializer library., (*2)

Usage

  1. Install the latest version with composer require mhujer/jms-serializer-uuid
  2. Register a custom handler to JMS Serializer (documentation)
<?php
$builder
    ->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) {
        $registry->registerSubscribingHandler(new \Mhujer\JmsSerializer\Uuid\UuidSerializerHandler());
    })
;

or if you are using Symfony, register it as a tagged service in services.yaml:, (*3)


Mhujer\JmsSerializer\Uuid\UuidSerializerHandler: tags: - { name: jms_serializer.subscribing_handler }

Then you can use the uuid type for serialization or deserialization:, (*4)

<?php

use JMS\Serializer\Annotation as JMS;

class User
{

    /**
     * @JMS\Type("uuid")
     * @var \Ramsey\Uuid\UuidInterface
     */
    public $id;

}

Requirements

Works with PHP 8.0 or higher., (*5)

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub, (*6)

Author

Martin Hujer, (*7)

Changelog

3.4.1 (2021-12-07)

  • #17 handle non-stringable values

3.4.0 (2021-11-05)

  • #15 Drop support for PHP < 8.0
  • #16 Add support for PHP 8.1

3.3.0 (2020-12-31)

  • #12 Drop support for PHP < 7.4
  • #11 Add support for PHP 8.0 (thank you @ahilles107!)

3.2.0 (2020-05-17)

  • #10 Add support for ramsey/uuid v4 (thank you @simPod!)

3.1.0 (2019-05-31)

  • #8 #9 Add jms/serializer 3.0 support (thank you @ilyashtrikul and @simPod!)

3.0.0 (2018-11-27)

  • #6 dropped support for PHP 7.1 as it is no longer supported
  • #7 Require jms/serializer 2.0

2.0.0 (2018-01-05)

  • #3 require PHP 7.1, potential BC breaks because of added type-hints

1.0.1 (2016-08-22)

  • #1 fixed serialization to XML

1.0.0 (2016-05-28)

  • initial release

The Versions

07/01 2018

dev-master

9999999-dev https://github.com/mhujer/jms-serializer-uuid

Uuid serializer and deserializer for JMS Serializer library

  Sources   Download

MIT

The Requires

 

The Development Requires

uuid serializer jms

07/01 2018
05/01 2018

dev-mh-upgrade

dev-mh-upgrade https://github.com/mhujer/jms-serializer-uuid

Uuid serializer and deserializer for JMS Serializer library

  Sources   Download

MIT

The Requires

 

The Development Requires

uuid serializer jms