定制 free-elephants/json-api-dto 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

free-elephants/json-api-dto

最新稳定版本:0.1.0

Composer 安装命令:

composer require free-elephants/json-api-dto

包简介

JsonApi Document Structure Types

README 文档

README

Build Status codecov Installs Releases

Features:

Build Data Transfer Objects from PSR7 Messages.

Full typed objects from request or response body.

See example in test.

Union types support for relationships in PHP 8.

Usage

Extend super types in your own json api documents and it's parts:

  • \FreeElephants\JsonApi\DTO\AbstractAttributes
  • \FreeElephants\JsonApi\DTO\AbstractDocument
  • \FreeElephants\JsonApi\DTO\AbstractRelationships
  • \FreeElephants\JsonApi\DTO\AbstractResourceObject

And use as properties types:

  • \FreeElephants\JsonApi\DTO\RelationshipToOne
  • \FreeElephants\JsonApi\DTO\ResourceIdentifierObject

See tests/ for more examples.

Install

composer require free-elephants/json-api-dto

Development

All dev env is dockerized. Your can use make receipts and bin/ scripts without locally installed php, composer.

For run tests with different php version change PHP_VERSION value in .env and rebuild image with make build.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2025-03-13