PHPackages                             rinsvent/request-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. rinsvent/request-bundle

ActiveLibrary

rinsvent/request-bundle
=======================

Request bundle

v0.0.8(3y ago)3202proprietaryPHPPHP ^8.0

Since Aug 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Rinsvent/request-bundle)[ Packagist](https://packagist.org/packages/rinsvent/request-bundle)[ RSS](/packages/rinsvent-request-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (9)Used By (0)

[![pipeline status](https://camo.githubusercontent.com/f558a7ec4787bd606d78d7184d507107bca9885d37d2d7b094d02011a556cd89/68747470733a2f2f6769742e72696e7376656e742e72752f73796d666f6e792f62756e646c65732f726571756573742d62756e646c652f6261646765732f6d61737465722f706970656c696e652e737667)](https://git.rinsvent.ru/symfony/bundles/request-bundle/-/commits/master)[![coverage report](https://camo.githubusercontent.com/524a1f9908a3726778f3ca049cf4ee271aefa45a296b25326ef244c4f01b93aa/68747470733a2f2f6769742e72696e7376656e742e72752f73796d666f6e792f62756e646c65732f726571756573742d62756e646c652f6261646765732f6d61737465722f636f7665726167652e737667)](https://git.rinsvent.ru/symfony/bundles/request-bundle/-/commits/master)

Request bundle
==============

[](#request-bundle)

Bundle умеет конвертировать request в DTO Полученная DTO валидируется. В случае ошибок выполнение прекращается и возвращаются ошибки. В случае успеха DTO присваиваются в атрибуты и доступны в методе контроллера.

### Пример запроса

[](#пример-запроса)

```
{
  "signin": {
    "transport": "phone",
    "value": "8888888888",
    "code": "password"
  }
}
```

### Пример DTO

[](#пример-dto)

```
namespace App\DTO\Request;

use Rinsvent\Data2DTO\Attribute\HandleTags;
use Rinsvent\Data2DTO\Attribute\VirtualProperty;
use Symfony\Component\Validator\Constraints as Assert;
use App\Validator as ProjectAssert;

use Rinsvent\Data2DTO\Attribute\PropertyPath;
use Rinsvent\Data2DTOBundle\Service\Transformer\Request\Headers\Header;
use Rinsvent\Data2DTOBundle\Service\Transformer\Request\Headers\UserAgent;
use Rinsvent\Data2DTOBundle\Service\Transformer\Request\Server\Ip;

#[HandleTags(method: 'getTags')]
class SigninRequest
{
    #[Assert\NotBlank(message: "error.transport.empty")]
    public string $transport;

    #[Assert\NotBlank(message: "error.value.empty")]
    #[Assert\Email(message: "error.email.wrong", groups: "email")]
    #[ProjectAssert\Phone(message: "error.phone.wrong", groups: "phone")]
    public string $value;

    #[Assert\NotBlank(message: "error.code.empty")]
    public string $code;
    #[VirtualProperty]
    public Device $device;

    public function getTags(array $data, array $tags)
    {
        $transport = $data['transport'] ?? null;
        if ($transport) {
            $tags[] = $transport;
        }
        return $tags;
    }
}

class Device
{
    #[Assert\NotBlank(message: "error.device.id.empty")]
    #[Header(property: 'X-Device-Id')]
    public string $deviceId;

    #[Assert\NotBlank(message: "error.device.source.empty")]
    #[Header(property: 'X-Source')]
    public string $source;

    #[Assert\NotBlank(message: "error.device.ip.empty")]
    #[Ip]
    public ?string $ip = null;

    #[Assert\NotBlank(message: "error.device.user_agent.empty")]
    #[UserAgent]
    public string $userAgent;
}
```

### Использование

[](#использование)

```
namespace App\Controller;

use App\Form\Type\User\DTO\SigninRequest;
use App\Service\Entity\UserService;
use Rinsvent\RequestBundle\Annotation\RequestDTO;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class UserController extends AbstractController
{
    public function __construct(
        private UserService $us
    ) {}

    #[Route('/v1/signin', name: 'signin', methods: ['POST'])]
    #[RequestDTO(className: SigninRequest::class, jsonPath: '$.signin')]
    public function signin(SigninRequest $signinRequest)
    {
        $signinResponse = $this->us->signin($signinRequest);

        return new JsonResponse(
            [],
            Response::HTTP_OK,
            [
                'X-Access-Token' => $signinResponse->getAccessToken(),
                'X-Refresh-Token' => $signinResponse->getRefreshToken(),
            ]
        );
    }

    // Вариант с несколькими DTO
    #[Route('/v1/signin', name: 'signin', methods: ['POST'])]
    #[RequestDTO(className: SigninRequest::class, jsonPath: '$.signin')]
    #[RequestDTO(className: Device::class)]
    public function signin2(SigninRequest $signinRequest, Device $device)
    {
        $signinResponse = $this->us->signin2($signinRequest, $device);
        return new JsonResponse();
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.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 ~64 days

Recently: every ~111 days

Total

8

Last Release

1290d ago

### Community

Maintainers

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

---

Top Contributors

[![rinsvent007](https://avatars.githubusercontent.com/u/183840611?v=4)](https://github.com/rinsvent007 "rinsvent007 (22 commits)")[![sipachev](https://avatars.githubusercontent.com/u/162081332?v=4)](https://github.com/sipachev "sipachev (12 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-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)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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