PHPackages                             mcc-api-tools/request-object-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. [API Development](/categories/api)
4. /
5. mcc-api-tools/request-object-bundle

ActiveSymfony-bundle[API Development](/categories/api)

mcc-api-tools/request-object-bundle
===================================

Simple RequestObject

1.0(1y ago)12.2kMITPHPPHP &gt;=8.1CI failing

Since May 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iliabox/request-object-bundle)[ Packagist](https://packagist.org/packages/mcc-api-tools/request-object-bundle)[ RSS](/packages/mcc-api-tools-request-object-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (10)Versions (8)Used By (0)

MCC Api Tools / Request Object Bundle
=====================================

[](#mcc-api-tools--request-object-bundle)

**Request Object Bundle** is a Symfony bundle designed to simplify handling HTTP requests by automatically transforming request parameters into objects and validating them.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher (with `php-json` extension)
- Symfony 6.2 or newer

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

[](#installation)

Run the following command to install the package via Composer:

```
composer require mcc-api-tools/request-object-bundle
```

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

[](#configuration)

1. **Add the package to your Symfony project** (if not already added):

    ```
    // config/bundles.php

    return [
        // ...
        MccApiTools\RequestObjectBundle\RequestObjectBundle::class => ['all' => true],
    ];
    ```
2. **Create a request object** that will represent your HTTP request data:

    ```
    // src/Request/CreateLocationRequest.php

    declare(strict_types=1);

    namespace App\Request;

    use MccApiTools\RequestObjectBundle\Model\AllowExtraAttributesInterface;
    use MccApiTools\RequestObjectBundle\Model\RequestObjectInterface;
    use Symfony\Component\Validator\Constraints as Assert;

    class CreateLocationRequest implements RequestObjectInterface, AllowExtraAttributesInterface
    {
        #[Assert\NotBlank(message: "The location name is required")]
        public string $name;

        #[Assert\NotBlank(message: "The location address is required")]
        public string $address;

        #[Assert\NotBlank(message: "The latitude is required")]
        #[Assert\Type(type: "float", message: "The latitude must be a number")]
        public float $latitude;

        #[Assert\NotBlank(message: "The longitude is required")]
        #[Assert\Type(type: "float", message: "The longitude must be a number")]
        public float $longitude;
    }
    ```
3. **Use the request object in your controller**:

    ```
    // src/Controller/LocationController.php

    declare(strict_types=1);

    namespace App\Controller;

    use App\Request\CreateLocationRequest;
    use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Component\Routing\Attribute\Route;

    class LocationController extends AbstractController
    {
        #[Route("/locations", methods: ["POST"])]
        public function create(CreateLocationRequest $request): Response
        {
            // Access request data via $request->name, $request->address, $request->latitude, $request->longitude

            // Logic for creating a location

            return new Response(null, 204);
        }
    }
    ```

Usage
-----

[](#usage)

- **Validation**: Request objects are automatically validated based on the constraints defined in their properties. If validation fails, a response with validation errors will be returned.
- **Accessing Data**: You can access request data directly through the request object properties in your controller.

Testing
-------

[](#testing)

To run tests, use the following command:

```
composer test
```

Contributing
------------

[](#contributing)

If you would like to contribute to this package, please open an issue or submit a pull request in the GitHub repository.

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

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

Recently: every ~352 days

Total

7

Last Release

551d ago

Major Versions

0.6 → 1.02024-12-19

PHP version history (3 changes)0.1.0PHP ^7.4

0.5PHP &gt;=7.4

0.6PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10348412?v=4)[iliabox](/maintainers/iliabox)[@iliabox](https://github.com/iliabox)

---

Top Contributors

[![iliabox](https://avatars.githubusercontent.com/u/10348412?v=4)](https://github.com/iliabox "iliabox (21 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/mcc-api-tools-request-object-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/mcc-api-tools-request-object-bundle/health.svg)](https://phpackages.com/packages/mcc-api-tools-request-object-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[sulu/sulu

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

1.3k1.4M196](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M514](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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