mhujer/jms-serializer-uuid 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mhujer/jms-serializer-uuid

最新稳定版本:3.4.1

Composer 安装命令:

composer require mhujer/jms-serializer-uuid

包简介

Uuid serializer and deserializer for JMS Serializer library

README 文档

README

Latest Stable Version Total Downloads License Coverage Status

This library allows you to serialize and deserialize ramsey/uuid UUIDs when using JMS Serializer library.

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:

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

Then you can use the uuid type for serialization or deserialization:

<?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.

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub

Author

Martin Hujer

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

统计信息

  • 总下载量: 1.16M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 29
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 29
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-14