gideonazure/class_serializer 问题修复 & 功能扩展

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

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

gideonazure/class_serializer

Composer 安装命令:

composer require gideonazure/class_serializer

包简介

This is a project for class serialization

README 文档

README

This project based on a default structure for PHP projects and help to serialize any class into JSON, YAML or XML formats.

Installation

Use the composer package to install class serializer.

composer require gideonazure/class_serializer

Usage

// require needed class to your project
use Serialize\SerializeJson;
use Serialize\SerializeYaml;
use Serialize\SerializeXml;

// create instance of a class
// with specifying the format of the final data as a class property

// for JSON output data
$JSON = new SerializeJson(); 

// for YAML output data
$YAML = new SerializeYaml(); 

// for XML output data
$XML = new SerializeXml();



// and then call  "serialize" method of instance 
// with passing data object

// return class object in JSON format
$JSON->serilalize(/* class object */);

// return class object in YAML format
$YAML->serilalize(/* class object */);

// return class object in XML format
$XML->serilalize(/* class object */);


// if need catch errors and return message use try->catch construction:
try {
    $JSON->serilalize(/* class object */);
} catch (\Exception $e){
    echo $e->getMessage();
}

Demo

For demo use and check the functionality - run the file "SerializeTester.php" from the "/tests" folder

php SerializeTester.php

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固