PHPackages                             thomas-institut/standard-api - 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. thomas-institut/standard-api

ActiveLibrary[API Development](/categories/api)

thomas-institut/standard-api
============================

Standard API responses for use in Thomas-Institut projects

1.0.0(2w ago)030↑50%2GPL-3.0-or-laterPHPPHP ^8.3

Since May 22Pushed 2w agoCompare

[ Source](https://github.com/thomas-institut/standard-api)[ Packagist](https://packagist.org/packages/thomas-institut/standard-api)[ RSS](/packages/thomas-institut-standard-api/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (2)

Standard API
============

[](#standard-api)

Standard API responses for use in Thomas-Institut projects.

This library provides a standard way to structure API responses in PHP projects, ensuring consistency across different services.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require thomas-institut/standard-api
```

Usage
-----

[](#usage)

### Success Response

[](#success-response)

The `SuccessResponse` class represents a successful API operation.

```
use ThomasInstitut\StandardApi\SuccessResponse;

$response = new SuccessResponse();
// $response->result will be ApiResult::Success
// $response->timeStamp will be set to current time
```

### Error Response

[](#error-response)

The `ErrorResponse` class represents a failed API operation with a message and an HTTP status code.

```
use ThomasInstitut\StandardApi\ErrorResponse;

$response = new ErrorResponse('An error occurred', 404);
// $response->result will be ApiResult::Error
// $response->message will be 'An error occurred'
// $response->httpStatus will be 404
```

Development
-----------

[](#development)

### Running Tests

[](#running-tests)

To run the tests, use the following command:

```
composer test
```

### Static Analysis

[](#static-analysis)

To run PHPStan for static analysis:

```
composer phpstan
```

### Code Coverage

[](#code-coverage)

To generate a code coverage report (requires Xdebug):

```
composer test:coverage
```

License
-------

[](#license)

This project is licensed under the GPL-3.0-or-later License - see the [LICENSE](LICENSE) file for details.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance96

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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

18d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17843226?v=4)[Rafael Nájera](/maintainers/rafaelnajera)[@rafaelnajera](https://github.com/rafaelnajera)

---

Top Contributors

[![rafaelnajera](https://avatars.githubusercontent.com/u/17843226?v=4)](https://github.com/rafaelnajera "rafaelnajera (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thomas-institut-standard-api/health.svg)

```
[![Health](https://phpackages.com/badges/thomas-institut-standard-api/health.svg)](https://phpackages.com/packages/thomas-institut-standard-api)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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