mhujer/jms-serializer-uuid
最新稳定版本:3.4.1
Composer 安装命令:
composer require mhujer/jms-serializer-uuid
包简介
Uuid serializer and deserializer for JMS Serializer library
关键字:
README 文档
README
This library allows you to serialize and deserialize ramsey/uuid UUIDs when using JMS Serializer library.
Usage
- Install the latest version with
composer require mhujer/jms-serializer-uuid - 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
Changelog
3.4.1 (2021-12-07)
- #17 handle non-stringable values
3.4.0 (2021-11-05)
3.3.0 (2020-12-31)
3.2.0 (2020-05-17)
- #10 Add support for ramsey/uuid v4 (thank you @simPod!)
3.1.0 (2019-05-31)
3.0.0 (2018-11-27)
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
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-14