PHPackages                             demartis/jttp - 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. demartis/jttp

ActiveLibrary[API Development](/categories/api)

demartis/jttp
=============

PHP implementation of JTTP standard protocol for REST

1.3.0(5y ago)152BSD-2-ClausePHPPHP &gt;=7.1

Since Sep 11Pushed 5y ago1 watchersCompare

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

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

JTTP
====

[](#jttp)

A simple PHP implementation of the [JTTP specification](https://github.com/demartis/jttp).

- [GitHub project](https://github.com/demartis/jttp-php)
- [Composer package](https://packagist.org/packages/demartis/jttp)

Usage
-----

[](#usage)

```
use Jttp\JttpResponse;

$data = ['field'=>'dummy data'];
$success = JttpResponse::ok($data);

$success = JttpResponse::success(200, "OK", $data);

$error = JttpResponse::error(401, null, ['Not cool.']);
$errorWithMessage = JttpResponse::error(401, 'not authorized', ['Not cool.']);
```

Create Jttp object from JttpResponse:

```
use Jttp\Jttp;
use Jttp\JttpResponse;
$data = ['field'=>'dummy data'];
$responseOkWithData = JttpResponse::ok($data);
$jttp = Jttp::createFromResponse($responseOkWithData);
```

Create Jttp object from simple response array:

```
use Jttp\Jttp;
use Jttp\JttpResponse;
$res =  array(
    "status" => "success",
    "code" => 200,
    "message"=> "OK",
    "data"=> ['field'=>'dummy data']
);

$jttp = Jttp::createFromJttpArray($res);

// get status
$jttp->getStatus(); // 'success'
$jttp->isSuccess(); // true
$jttp->getData(); // ['field'=>'dummy data']
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~1 days

Total

4

Last Release

2070d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7d5e06471683a06e8ff3f7dc824f1d29aac21fb7bf24b203dd30cd38818f994?d=identicon)[demartis](/maintainers/demartis)

---

Top Contributors

[![demartis](https://avatars.githubusercontent.com/u/4356583?v=4)](https://github.com/demartis "demartis (10 commits)")

---

Tags

jsonjttpphpresponserest-apistandard

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/demartis-jttp/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[mjaschen/collmex

Collmex PHP SDK

2080.7k](/packages/mjaschen-collmex)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

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