承接 gbprod/uuid-normalizer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gbprod/uuid-normalizer

最新稳定版本:v7.0.2

Composer 安装命令:

composer require gbprod/uuid-normalizer

包简介

Normalizer to serialize Ramsey Uuid with Symfony Serializer

README 文档

README

Tests Latest Stable Version Total Downloads Latest Unstable Version

Normalizer to serialize Ramsey Uuid using Symfony Serializer.

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:

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

Setup

In your app/config/service.yml file:

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

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

Or using xml:

<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:

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:

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.

统计信息

  • 总下载量: 597.93k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 33
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 32
  • Watchers: 2
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2016-03-19