承接 jder/psr 相关项目开发

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

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

jder/psr

最新稳定版本:0.1.0

Composer 安装命令:

composer require jder/psr

包简介

A response builder for PSR

README 文档

README

A response builder for PSR.

This package includes different response builders based on the JSON response structure specified in JSON Data Errors Response (JDER). With the builders, various kinds of responses can be created easily instead of sending plain text responses.

Installation

Install this package as a dependency in the project:

composer require jder/psr

Quick Start

To create a JSON response, use the following code:

use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Jder\Psr\Json\CreateJsonResponse;

function route(
    Request $request,
    Response $response,
): Response {
    return CreateJsonResponse::success($response)->create();
}

And the response will be shown as below:

{
    "success": true,
    "data": null,
    "errors": []
}

Documentation

For the documentation,please refer to the documentation.

Contributing

For contributing, please refer to the contributing guide.

License

This project is licensed under the terms of the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-16