PHPackages                             soumenpasari/response-creator - 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. soumenpasari/response-creator

ActiveLibrary

soumenpasari/response-creator
=============================

A simple small library to help you create and manage responses of your code and return it

v1.0.0(6y ago)16[1 PRs](https://github.com/soumenpasari/responseCreator/pulls)MITPHPCI passing

Since Jan 12Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/soumenpasari/responseCreator)[ Packagist](https://packagist.org/packages/soumenpasari/response-creator)[ RSS](/packages/soumenpasari-response-creator/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

RESPONSE CREATOR
================

[](#response-creator)

---

[![](https://camo.githubusercontent.com/24f1c1fdf1b894382416e97a6cd98c0b6b77e5f257a13186e427edf5326aecc5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f736f756d656e7061736172692f726573706f6e736543726561746f72)](https://camo.githubusercontent.com/24f1c1fdf1b894382416e97a6cd98c0b6b77e5f257a13186e427edf5326aecc5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f736f756d656e7061736172692f726573706f6e736543726561746f72) [![](https://camo.githubusercontent.com/5bea641f4cc33d9138376ca1dbf96054f608230610ac69be7f7e189ac1436d66/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f736f756d656e7061736172692f726573706f6e736543726561746f72)](https://camo.githubusercontent.com/5bea641f4cc33d9138376ca1dbf96054f608230610ac69be7f7e189ac1436d66/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f736f756d656e7061736172692f726573706f6e736543726561746f72) [![](https://camo.githubusercontent.com/76242d510c5d0d81ad55eb1aef0d91d3c255313e78d606f52bcf1f4ecbdc7184/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f756d656e7061736172692f726573706f6e73652d63726561746f72)](https://camo.githubusercontent.com/76242d510c5d0d81ad55eb1aef0d91d3c255313e78d606f52bcf1f4ecbdc7184/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f756d656e7061736172692f726573706f6e73652d63726561746f72) [![](https://camo.githubusercontent.com/09ff38b9f83662c4424b343ab2ec2a35d4d47adfcbc490ef575ab483fc03b14f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f756d656e7061736172692f726573706f6e736543726561746f72)](https://camo.githubusercontent.com/09ff38b9f83662c4424b343ab2ec2a35d4d47adfcbc490ef575ab483fc03b14f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f756d656e7061736172692f726573706f6e736543726561746f72)

This is a response manager library, basically used to manage response of your code and program for later use or use cases. It helps in managing responses of several module withing your code and return the response according to your needs. This is a static library so you don't need to create any object of it.

### Features!

[](#features)

- Manages response of your code or API.
- Multiple branch of response can be created and managed.
- Different branches can be merged
- Return or get response in two formats ie; either array or json format.
- Helps to maintain http response code of your program.

### Installation via compser

[](#installation-via-compser)

```
composer require soumenpasari/response-creator
```

### Configuration required

[](#configuration-required)

Works with PHP v5.6 or above

---

Documentation
-------------

[](#documentation)

> This guide will help you understand how to use this static library. This is a **static library**, you don't have to create an object of it.

### Baisc usage

[](#baisc-usage)

```

```

#### Alaising the namespace (if you need it)

[](#alaising-the-namespace-if-you-need-it)

```
use \soumenpasari\responseCreator\ResponseCreator as rpc;

```

#### Understanding the branches

[](#understanding-the-branches)

By default there is only one branch ie; master branch of your whole response, and whatever you record is recorded or stored under your master branch of response.
**Why do you need to create branches** : Suppose the application or software or API that you are working on have different modules and you want to track responses of multiple modules that your code goes through in a single run. For example like when a log in module is executed there is are several modules like:

- backend validation of user input data
- checking user id exist or not
- checking password for that user is valid or not
- creating session if user credentials are valid and then redirecting

So, there are different modules for which you can create a different branch of response and analyse and let you make your code act accordingly ie; if it passed or not and if it fails then what was the message of it. All these information according to your branch can be fetched and managed.

#### Logging success

[](#logging-success)

```
rpc::success(branch_name,message_to_log,http_response_code,data_to_log)

```

- branch\_name - *string* -name of your branch, if its master branch then you have to mention it. (**required**)
- message\_to\_log - *string* -message to log in that branch. (requried)
- http\_response\_code - *int* - http response code of your code to be set (in here mostly is 200). (**required**)
- data\_to\_log - *array* -array or any other data to log within your respective branch. (**optional**)

#### Logging error

[](#logging-error)

```
rpc::error(branch_name,message_to_log,http_response_code,data_to_log)

```

- branch\_name - *string* - name of your branch, if its master branch then you have to mention it. (**required**)
- message\_to\_log - *string* - message to log in that branch. (**required**)
- http\_response\_code - *int* - http response code of your code to be set (default value : 400) (**optional**)
- data\_to\_log - *array* - array or any other data to log within your respective branch. (**optional**)

#### Merging two branches

[](#merging-two-branches)

```
rpc::merge(branch_that_to_merge,branch_to_be_merged_into,delete_merged_branch)

```

- branch\_that\_to\_merge - *string* - name of the branch that to be merged. (**required**)
- branch\_to\_be\_merged\_into - *string* - name of the branch that the other branch to be merged to. (**default value : master**)(**optional**)
- delete\_merged\_branch - *boolean* - set true if you want to delete the merged branch after it get merged. (**default value : true**) (**optional**)

#### Reset response values of any branch

[](#reset-response-values-of-any-branch)

```
rpc::reset(branch_name)

```

- branch\_name - *string* - name of the branch to reset. (**default value : master**). (**optional**)

#### Get response

[](#get-response)

```
rpc::getResponse(type_of_response,branch_name)

```

- type\_of\_response - *string* - type of response to fetch ie; array or json. (**default value : array**). (**optional**).
    - array - if you want response to be in the form of array then parameter will be array.
    - json - if you want the response to be fetched in the form of json.
- branch\_name - *string* - name of the branch to fetch the response of. By default if no parameter is passed then all branches response will be fetched. (**optional**)

License
-------

[](#license)

responseCreator is licensed under MIT License - see the `License` for details.

###  Health Score

35

↑

LowBetter than 79% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2309d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/180270b8d82adc70800119dcabfafdeb9cb4a9b3f173f21b0dd50a42529a4fc7?d=identicon)[Soumen Pasari](/maintainers/Soumen%20Pasari)

---

Top Contributors

[![soumenpasari](https://avatars.githubusercontent.com/u/16715116?v=4)](https://github.com/soumenpasari "soumenpasari (9 commits)")

---

Tags

php-libraryphp7response-management

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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