2017 © Pedro Peláez
 

library uuid-normalizer

Normalizer to serialize Ramsey Uuid with Symfony Serializer

image

gbprod/uuid-normalizer

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  • Thursday, February 22, 2018
  • by gbprod
  • Repository
  • 1 Watchers
  • 4 Stars
  • 3,799 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 57 % Grown

The README.md

Uuid normalizer

Tests Latest Stable Version Total Downloads Latest Unstable Version, (*1)

Normalizer to serialize Ramsey Uuid using Symfony Serializer., (*2)

Installation

composer require gbprod/uuid-normalizer

Why

By default, Symfony Serializer can't handle serialization and deserialization of Ramsey Uuid. You will have that kind of errors:, (*3)

Not a time-based UUID
500 Internal Server Error - UnsupportedOperationException

Setup

In your app/config/service.yml file:, (*4)

services:
  uuid_normalizer:
    class: GBProd\UuidNormalizer\UuidNormalizer
    tags:
      - { name: serializer.normalizer }

  uuid_denormalizer:
    class: GBProd\UuidNormalizer\UuidDenormalizer
    tags:
      - { name: serializer.normalizer }

Or using xml:, (*5)

<services>
    <service id="uuid_normalizer" class="GBProd\UuidNormalizer\UuidNormalizer">
        <tag name="serializer.normalizer" />
    </service>
    <service id="uuid_denormalizer" class="GBProd\UuidNormalizer\UuidDenormalizer">
        <tag name="serializer.normalizer" />
    </service>
</services>

Or php:, (*6)

use Symfony\Component\DependencyInjection\Definition;

$definition = new Definition('GBProd\UuidNormalizer\UuidNormalizer');
$definition->addTag('serializer.normalizer');
$container->setDefinition('uuid_normalizer', $definition);

$definition = new Definition('GBProd\UuidNormalizer\UuidDenormalizer');
$definition->addTag('serializer.normalizer');
$container->setDefinition('uuid_denormalizer', $definition);

Or building your own serializer:, (*7)

use GBProd\UuidNormalizer\UuidDenormalizer;
use GBProd\UuidNormalizer\UuidNormalizer;

$serializer = new Serializer([
    new UuidNormalizer(),
    new UuidDenormalizer(),
    // Other normalizers...
]);

Requirements

  • PHP 7.4+

Contributing

Feel free to contribute, see CONTRIBUTING.md file for more informations., (*8)

The Versions

22/02 2018

dev-master

9999999-dev

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

MIT WTFPL

The Requires

 

The Development Requires

by Avatar gbprod

22/02 2018

dev-chore/licence

dev-chore/licence

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

WTFPL

The Requires

 

The Development Requires

by Avatar gbprod

10/01 2018

v1.1.0

1.1.0.0

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

10/01 2018

dev-release-1.1.0

dev-release-1.1.0

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

09/01 2018

dev-SF4

dev-SF4

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

01/06 2016

v1.0.1

1.0.1.0

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

19/03 2016

v1.0.0

1.0.0.0

Normalizer to serialize Ramsey Uuid with Symfony Serializer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod