PHPackages                             kirsankifat/request-data-bundle - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. kirsankifat/request-data-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

kirsankifat/request-data-bundle
===============================

Represents request data in a structured and useful way.

v1.4.2(4y ago)036MITPHPPHP ^7.4|^8.0

Since Oct 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/KirsanKifat/request-data-bundle)[ Packagist](https://packagist.org/packages/kirsankifat/request-data-bundle)[ RSS](/packages/kirsankifat-request-data-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (7)Versions (9)Used By (0)

Request data bundle
===================

[](#request-data-bundle)

This bundle allows you to represent request data in a structured and useful way by creating request data classes.

**Features**:

- Detecting how to extract data depends on request method and `Content-Type` header.
- Representing and normalizing query parameters for the `GET` request method.
- Representing `form`, `json`, `xml` request body for the `POST`, `PUT`, `PATCH` request methods.
- Defining supported formats and throwing exception if the request format is unsupported.
- Dispatching the finish event when request data is ready.

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

[](#installation)

Run the following command using [Composer](http://packagist.org):

```
composer require bilyiv/request-data-bundle
```

Configuration
-------------

[](#configuration)

The default configuration is the following:

```
request_data:
    prefix: App\RequestData
```

Usage
-----

[](#usage)

#### Create a request data class

[](#create-a-request-data-class)

```
namespace App\RequestData;

class PostRequestData implements FormatSupportableInterface
{
    public const DEFAULT_AUTHOR = 'none';

    /**
     * @var string
     */
    public $title;

    /**
     * @var string
     */
    public $author = self::DEFAULT_AUTHOR;

    /**
     * {@inheritdoc}
     */
    public static function getSupportedFormats(): array
    {
        return [Formats::FORM, Formats::JSON, Formats::XML];
    }
}
```

#### Use it in your controller

[](#use-it-in-your-controller)

```
namespace App\Controller;

class PostController extends AbstractController
{
    /**
     * @Route("/", name="action")
     */
    public function action(PostRequestData $data)
    {
       return new JsonResponse($data);
    }
}
```

#### Make requests

[](#make-requests)

All the following requests will return the same json response:

```
{
    "title": "Hamlet",
    "author": "William Shakespeare"
}
```

`GET` request:

```
curl -X GET 'https://example.com?title=Hamlet&author=William+Shakespeare'
```

`POST` form request:

```
curl -X POST 'https://example.com' \
     -H 'Content-Type: application/x-www-form-urlencoded' \
     -d 'title=Hamlet&author=William+Shakespeare'
```

`POST` json request:

```
curl -X POST 'https://example.com' \
     -H 'Content-Type: application/json' \
     -d '{"title":"Hamlet","author":"William Shakespeare"}'
```

`POST` xml request:

```
curl -X POST 'https://example.com' \
     -H 'Content-Type: application/xml' \
     -d 'HamletWilliam Shakespeare'
```

`POST` csv request throws an exception because of unsupported format:

```
curl -X POST 'https://example.com' \
     -H 'Content-Type: application/csv' \
     -d 'Hamlet,William Shakespeare'
```

License
-------

[](#license)

This bundle is released under the MIT license. See the included [LICENSE](LICENSE) file for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~18 days

Recently: every ~32 days

Total

8

Last Release

1550d ago

PHP version history (2 changes)v1.3.0PHP ^8.0

v1.4.2PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7126369a7e9405cb62a94bfc6e6c80c6c7c6bf709971a19ab69768f59191baaa?d=identicon)[KirsanKifat](/maintainers/KirsanKifat)

---

Top Contributors

[![KirsanKifat](https://avatars.githubusercontent.com/u/27862784?v=4)](https://github.com/KirsanKifat "KirsanKifat (11 commits)")

---

Tags

requestjsonapirestdata

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kirsankifat-request-data-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kirsankifat-request-data-bundle/health.svg)](https://phpackages.com/packages/kirsankifat-request-data-bundle)
```

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k48.1M236](/packages/api-platform-core)[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[lexik/jwt-authentication-bundle

This bundle provides JWT authentication for your Symfony REST API

2.6k58.7M210](/packages/lexik-jwt-authentication-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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