mhujer/jms-serializer-uuid-bundle

此软件包已被废弃,不再维护。作者建议使用手动注册UUID处理器,见README。软件包代替。

Symfony集成JMS Serializer库的Uuid序列化和反序列化器

安装次数: 375,052

依赖项: 0

建议者: 0

安全: 0

星标: 12

关注者: 3

分支: 6

公开问题: 1

类型:symfony-bundle

4.2.0 2020-12-31 11:25 UTC

This package is auto-updated.

Last update: 2021-11-05 10:17:56 UTC


README

Latest Stable Version Total Downloads License Coverage Status

此Bundle将mhujer/jms-serializer-uuid集成到Symfony中。

注意

除了使用此Bundle,您还可以在config/services.yaml文件中手动注册处理器

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


Usage
----
1. Install the latest version with `composer require mhujer/jms-serializer-uuid-bundle`
2. Register the Bundle in the `AppKernel.php`:

```php
<?php

class AppKernel extends \Symfony\Component\HttpKernel\Kernel
{

	...

	public function registerBundles()
	{
		$bundles = [
			...
			new Mhujer\JmsSerializer\Uuid\SymfonyBundle\MhujerJmsSerializerUuidBundle()
		];

	}

然后您可以使用uuid类型进行序列化或反序列化

<?php

use JMS\Serializer\Annotation as JMS;

class User
{

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

}

要求

适用于PHP 7.2或更高版本。

提交错误和功能请求

错误和功能请求在GitHub上跟踪

作者

Martin Hujer

感谢Vašek Purchart提供测试Symfony DI扩展的想法!

变更日志

4.0.0 (2018-11-27)

  • #6 删除了对PHP 7.1的支持,因为它不再受支持
  • #7 支持jms/serializer 2.0(感谢@simPod!)

3.0.0 (2018-01-07)

  • #3 添加了对Symfony 4.0的支持,删除了对Symfony 2的支持。需要PHP 7.1。

2.0.0 (2017-08-09)

  • #1 支持JMS Serializer Bundle 2.0(感谢@VasekPurchart!)

1.0.0 (2015-05-XX)

  • 初始版本