PHPackages                             kiwfy/response-json-php - 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. [API Development](/categories/api)
4. /
5. kiwfy/response-json-php

Abandoned → [not-empty/response-json-php-lib](/?search=not-empty%2Fresponse-json-php-lib)Library[API Development](/categories/api)

kiwfy/response-json-php
=======================

PHP library to create a response json pattern to API's

8.0.0(4mo ago)712.9k1GPL-3.0-onlyPHPPHP ^8.4CI passing

Since Nov 9Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/not-empty/response-json-php-lib)[ Packagist](https://packagist.org/packages/kiwfy/response-json-php)[ RSS](/packages/kiwfy-response-json-php/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (8)Dependencies (4)Versions (10)Used By (0)

PHP Response Json
=================

[](#php-response-json)

[![Latest Version](https://camo.githubusercontent.com/a3d452060f695f27b6c603941bdbb63ec4eb86769021513bc14b933c6d7962a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6e6f742d656d7074792f726573706f6e73652d6a736f6e2d7068702d6c69622e7376673f7374796c653d666c61742d737175617265)](https://github.com/not-empty/response-json-php-lib/releases)[![codecov](https://camo.githubusercontent.com/ddae002881485e112d5927af05172e52a140010c6f806a9b8ceafb9a00fcd553/68747470733a2f2f636f6465636f762e696f2f67682f6e6f742d656d7074792f726573706f6e73652d6a736f6e2d7068702d6c69622f67726170682f62616467652e7376673f746f6b656e3d41454d56313633555736)](https://codecov.io/gh/not-empty/response-json-php-lib)[![CI Build](https://camo.githubusercontent.com/1951cd9a1b38426a7ebded823951086ae1ffa0958956977dfda0753c69c6e4f3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6f742d656d7074792f726573706f6e73652d6a736f6e2d7068702d6c69622f7068702e796d6c)](https://github.com/not-empty/response-json-php-lib/actions/workflows/php.yml)[![Downloads Old](https://camo.githubusercontent.com/caf6d30661d6bb87f790224b5436ecaf0dcea681b9fcca5fa61cfc1ede97aecc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b697766792f726573706f6e73652d6a736f6e2d7068703f6c6f676f3d6f6c64266c6162656c3d646f776e6c6f6164732532306c6567616379)](https://packagist.org/packages/kiwfy/response-json-php)[![Downloads](https://camo.githubusercontent.com/d1ab66350084ccecd6401720bce2c878c56ae42ecacdd2c2c09773e52e3ee94e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f742d656d7074792f726573706f6e73652d6a736f6e2d7068702d6c69623f6c6f676f3d6f6c64266c6162656c3d646f776e6c6f616473)](https://packagist.org/packages/not-empty/response-json-php-lib)[![PRs Welcome](https://camo.githubusercontent.com/25b3e6d0d42c98de74a98cbb4d149a1c09020cf6d1361993b72d7d5b8ffed363/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://makeapullrequest.com)[![Packagist License (custom server)](https://camo.githubusercontent.com/39d651af07b16362a87176085f06b685e8d4030b6a16d81dc8cb8f53738f3ca2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6f742d656d7074792f726573706f6e73652d6a736f6e2d7068702d6c6962)](https://github.com/not-empty/response-json-php-lib/blob/master/LICENSE)

PHP library to create a response json pattern to API's

### Installation

[](#installation)

[Release 8.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/8.0.0) Requires [PHP](https://php.net) 8.4

[Release 7.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/7.0.0) Requires [PHP](https://php.net) 8.3

[Release 6.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/6.0.0) Requires [PHP](https://php.net) 8.2

[Release 5.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/5.0.0) Requires [PHP](https://php.net) 8.1

[Release 4.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/4.0.0) Requires [PHP](https://php.net) 7.4

[Release 3.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/3.0.0) Requires [PHP](https://php.net) 7.3

[Release 2.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/2.0.0) Requires [PHP](https://php.net) 7.2

[Release 1.0.0](https://github.com/not-empty/response-json-php-lib/releases/tag/1.0.0) Requires [PHP](https://php.net) 7.1

The recommended way to install is through [Composer](https://getcomposer.org/).

```
composer require not-empty/response-json-php-lib
```

### Usage

[](#usage)

Creating a response

```
use ResponseJson\ResponseJson;
$responseJson = new ResponseJson();
$token = [
    'token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' .
        'eyJhdWQiOiJ0ZXN0IiwiZXhwIjozMCwiaWF0I' .
        'joxNTYyMTcwOTIwLCJpc3MiOiJ0ZXN0Iiwic3' .
        'ViIjoiIn0=.wPdhZtjpyBjObFWbxPx33GNJpv' .
        'KHIznPV0GQ2NiQp5A=',
    'valid_until' => '2020-06-16 12:36:34',
];
$data = [
    'data' => 'test',
];
$response = $responseJson->response(
    'd0684895-cb6c-4c9a-a0aa-0aed7cfc1f46',
    microtime(true)-0.1,
    $token,
    $data,
    'message'
);
var_dump($response);
```

if you want an environment to run or test it, you can build and install dependences like this

```
docker build --build-arg PHP_VERSION=8.4-cli -t not-empty/response-json-php-lib:php84 -f contrib/Dockerfile .
```

Access the container

```
docker run --name response-json-php-lib -v ${PWD}/:/var/www/html -it not-empty/response-json-php-lib:php84 bash
```

Verify if all dependencies is installed

```
composer install --no-dev --prefer-dist
```

and run

```
php sample/response-json-sample.php
```

### Development

[](#development)

Want to contribute? Great!

The project using a simple code. Make a change in your file and be careful with your updates! **Any new code will only be accepted with all validations.**

To ensure that the entire project is fine:

First you need to building a correct environment to install all dependences

```
docker build --build-arg PHP_VERSION=8.4-cli -t not-empty/response-json-php-lib:php84 -f contrib/Dockerfile .
```

Access the container

```
docker run --name response-json-php-lib -v ${PWD}/:/var/www/html -it not-empty/response-json-php-lib:php84 bash
```

Install all dependences

```
composer install --dev --prefer-dist
```

Run all validations

```
composer check
```

**Not Empty Foundation - Free codes, full minds**

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance76

Regular maintenance activity

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 87% 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 ~113 days

Recently: every ~197 days

Total

8

Last Release

130d ago

Major Versions

2.0.0 → 3.0.02023-11-09

3.0.0 → 4.0.02023-11-09

4.0.0 → 6.0.02023-11-09

6.0.0 → 7.0.02023-11-27

7.0.0 → 8.0.02026-01-06

PHP version history (8 changes)5.0.0PHP ^8.1

1.0.0PHP ^7.1

2.0.0PHP ^7.2

3.0.0PHP ^7.3

4.0.0PHP ^7.4

6.0.0PHP ^8.2

7.0.0PHP ^8.3

8.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a8e537dba9018eff457d477dba8f79158989b41ca86bd74d1c4a1186c158caa?d=identicon)[kiwfy](/maintainers/kiwfy)

---

Top Contributors

[![leodisarli](https://avatars.githubusercontent.com/u/1638455?v=4)](https://github.com/leodisarli "leodisarli (20 commits)")[![brunavitoria](https://avatars.githubusercontent.com/u/43785466?v=4)](https://github.com/brunavitoria "brunavitoria (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kiwfy-response-json-php/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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