PHPackages                             tandrewcl/api-response-convert - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tandrewcl/api-response-convert

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tandrewcl/api-response-convert
==============================

Simple json response converter

v1.0.0(9mo ago)1489↓50%1MITPHPPHP &gt;=8.0.2

Since Aug 10Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/TAndrewCL/api-response-convert)[ Packagist](https://packagist.org/packages/tandrewcl/api-response-convert)[ RSS](/packages/tandrewcl-api-response-convert/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Response Convert Bundle
=======================

[](#response-convert-bundle)

About bundle
------------

[](#about-bundle)

This bundle is a simple solution to convert models/DTO/Exceptions to JsonResponse

Installation
============

[](#installation)

Step 1: Download the Bundle
---------------------------

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
    $ composer require tandrewcl/api-response-convert
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Step 2: Config and Usage
------------------------

[](#step-2-config-and-usage)

Thanks for Symfony flex Bundle is auto enabled in config/bundles.php

```
...
use tandrewcl\ApiResponseConvertBundle\Converter\ResponseConverterInterface;
use tandrewcl\ApiResponseConvertBundle\Handler\ResponseHandler;
use tandrewcl\ApiResponseConvertBundle\Model\ConvertedResponseModel;
...

class FooConverter implements ResponseConverterInterface
{
    public static function getDefaultSupportedClassPriority(): int
    {
        return -245;
    }

    public function support(mixed $data): bool
    {
        return $data instanceof \Exception;
    }

    public static function getDefaultSupportedClassName(): string
    {
        return \Exception::class;
    }

    /**
     * @param \Exception $data
     */
    public function convert(mixed $data, ResponseHandler $responseHandler): ConvertedResponseModel
    {
        return new ConvertedResponseModel(
           message: $data->getMessage(), statusCode: Response::HTTP_INTERNAL_SERVER_ERROR
        );
    }
}
```

```
...
use tandrewcl\ApiResponseConvertBundle\Handler\ResponseHandler;
use Symfony\Component\HttpFoundation\JsonResponse;
...

class FooController
{
    public function __construct(
        private readonly ResponseHandler $responseHandler
    )
    {
    }

    public function indexAction(): JsonResponse
    {
        ...

        return $this->responseHandler->generateResponse($data);
    }
```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance61

Regular maintenance activity

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~272 days

Total

5

Last Release

278d ago

Major Versions

v0.2.2 → v1.0.02025-08-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/02494ea4e74d55bc7ba43f00e7721b48849239910705b97837205ac0332e1c7f?d=identicon)[ATernovtsii](/maintainers/ATernovtsii)

---

Top Contributors

[![ATernovtsii](https://avatars.githubusercontent.com/u/13164912?v=4)](https://github.com/ATernovtsii "ATernovtsii (6 commits)")[![ITernovtsii](https://avatars.githubusercontent.com/u/2779573?v=4)](https://github.com/ITernovtsii "ITernovtsii (1 commits)")

---

Tags

response converter. json response converter. symfony response converter

### Embed Badge

![Health badge](/badges/tandrewcl-api-response-convert/health.svg)

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

###  Alternatives

[illuminate/cookie

The Illuminate Cookie package.

224.3M120](/packages/illuminate-cookie)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)[robole/sulu-ai-translator-bundle

Translate any type of content using DeepL

181.3k](/packages/robole-sulu-ai-translator-bundle)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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