PHPackages                             heartide/response - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. heartide/response

ActiveLibrary[HTTP &amp; Networking](/categories/http)

heartide/response
=================

基于Hyperf2.0扩展Response

1.0.2(5y ago)0231MITPHP

Since Jul 15Pushed 5y agoCompare

[ Source](https://github.com/heartide-develop/response)[ Packagist](https://packagist.org/packages/heartide/response)[ RSS](/packages/heartide-response/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

项目概述
====

[](#项目概述)

- 基于Hyperf2.0中的Response扩展

运行环境
====

[](#运行环境)

确保操作环境满足以下要求:

- PHP &gt;= 7.2
- Swoole PHP extension &gt;= 4.4，and Disabled `Short Name`
- OpenSSL PHP extension
- JSON PHP extension
- PDO PHP extension （If you need to use MySQL Client）
- Redis PHP extension （If you need to use Redis Client）
- Protobuf PHP extension （If you need to use gRPC Server of Client）

安装
==

[](#安装)

- 引入组件

```
$ compsoer require "heartide/response"
```

使用
==

[](#使用)

- 文件

```
app/Controller/AbstractController.php
```

- 删除

```
use Hyperf\HttpServer\Contract\ResponseInterface;
```

注入
==

[](#注入)

```
use Heartide\Response\Response;
use Psr\Container\ContainerInterface;

    /**
     * @Inject
     * @var Response
     */
    protected $response;
```

- 在任意类中extends AbstractController

```
   class IndexController extends AbstractController
   {
       public function index()
       {
           $data = [
                'order_id' => 1234
            ];
           return $this->response->success($data);
       }
   }
```

- 效果

```
{
  "code": 0,
  "data": {
    "order_id": 1234
  }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b50bf96cea532231f5a1d667dd4fe44329eeba0c96f04cbc7acca99da1fd925?d=identicon)[heartide](/maintainers/heartide)

---

Top Contributors

[![heartides](https://avatars.githubusercontent.com/u/67720736?v=4)](https://github.com/heartides "heartides (1 commits)")[![TobyQu](https://avatars.githubusercontent.com/u/10667296?v=4)](https://github.com/TobyQu "TobyQu (1 commits)")

### Embed Badge

![Health badge](/badges/heartide-response/health.svg)

```
[![Health](https://phpackages.com/badges/heartide-response/health.svg)](https://phpackages.com/packages/heartide-response)
```

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[hyperf/guzzle

Swoole coroutine handler for guzzle

102.7M292](/packages/hyperf-guzzle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
