承接 attributes-php/serialization 相关项目开发

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

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

attributes-php/serialization

最新稳定版本:v0.3.1

Composer 安装命令:

composer require attributes-php/serialization

包简介

Serializes any class instance into a primitive type

README 文档

README

Code Coverage Latest Version Software License

Attributes Serialization is a library that serializes any object into a PHP primitive type

Features

  • Converts any type of object into a primitive type
  • Support for alias, alias generators and more via Attributes

Requirements

We aim to support versions that haven't reached their end-of-life.

How it works?

<?php

use Attributes\Serialization\Serializer;

class Person
{
    public float|int $age;
    public ?DateTime $birthday;
}

$person = new Person; 
$person->age = 30;
$person->birthday = new DateTime("2023-10-27T14:30:00Z");

$serializer = new Serializer;
$data = $serializer->serialize($person);

var_dump($data);  // array(2) { ["age"]=> int(30) ["birthday"]=> string(25) "2023-10-27T14:30:00+00:00" }

Installation

composer require attributes-php/serialization

Attributes Validation was created by André Gil and is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 350
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-18