PHPackages                             ed.sukharev/request-headers-param-converter - 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. ed.sukharev/request-headers-param-converter

ActiveLibrary[API Development](/categories/api)

ed.sukharev/request-headers-param-converter
===========================================

This param converter for Sensio Framework Extra Bundle adds convenient HTTP headers handling

v1.1.0(5y ago)01.1kMITPHPPHP &gt;=5.4

Since Jan 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/eduard-sukharev/request-headers-param-converter)[ Packagist](https://packagist.org/packages/ed.sukharev/request-headers-param-converter)[ RSS](/packages/edsukharev-request-headers-param-converter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

Request Headers ParamConverter for SensioFrameworkExtraBundle
=============================================================

[](#request-headers-paramconverter-for-sensioframeworkextrabundle)

This package contains simple yet convenient ParamConverter for injecting HTTP headers into controller actions.

Read about SensioFrameworkExtraBundle on its [official homepage](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html).

Usage
-----

[](#usage)

Define `RequestHeader` as a service (in `config.yml`):

```
services:
    EdSukharev\App\ParamConverter\RequestHeaders:
        tags:
            - { name: 'request.param_converter', converter: 'request_header_converter', priority: '-60' }
```

And in your Controller:

```
namespace App\Controller\Api;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;

class ApiController
{
    /**
     * @Route("/", methods={"GET"})
     * @ParamConverter("XAuthenticatedUserId", class="int", isOptional=true, converter="request_header_converter")
     * @ParamConverter("ContentType", class="string", isOptional=false, converter="request_header_converter")
     * @ParamConverter("XRequireAuth", class="string", isOptional=false, converter="request_header_converter")
     */
    public function getUserInfo($xAuthenticatedUserId, $contentType, $xRequireAuth) {
        return new JsonResponse([
            'XAuthenticatedUserId' => $xAuthenticatedUserId,
            'ContentType' => $contentType,
            'XRequireAuth' => $xRequireAuth,
        ]);
    }
}
```

Then, provided following request:

```
curl localhost -H 'x-require-auth: false' -H 'content-type: application/json'

```

the response will be:

```
{
  "XAuthenticatedUserId": null,
  "ContentType": "application/json",
  "XRequireAuth": false
}
```

Annotation parameters
---------------------

[](#annotation-parameters)

ParamConverter annotation receives following parameters as arguments: - **name** — name of the header to look for, also used to generate controller action argument name - **class** — defines type of the argument. By default, all headers received as strings. - **isOptional** — when header is missing, and this is set to false, then `\EdSukharev\App\ParamConverter\MissingHeaderException` will be thrown, otherwise argument value will be set to null. - **converter** — has to be `request_header_converter` for this request parameter to be handled by this library.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~0 days

Total

3

Last Release

1983d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe156a4d3014d5a3329ed208a2be772052b0dc2d6c4622e01194470793618acd?d=identicon)[eduard-sukharev](/maintainers/eduard-sukharev)

---

Top Contributors

[![eduard-sukharev](https://avatars.githubusercontent.com/u/3235378?v=4)](https://github.com/eduard-sukharev "eduard-sukharev (7 commits)")

---

Tags

apisymfonyparamconverterparam-converter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/edsukharev-request-headers-param-converter/health.svg)

```
[![Health](https://phpackages.com/badges/edsukharev-request-headers-param-converter/health.svg)](https://phpackages.com/packages/edsukharev-request-headers-param-converter)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

46688.8k5](/packages/deepseek-php-deepseek-php-client)[harmbandstra/swagger-ui-bundle

Exposes swagger UI inside your Symfony project through a route (eg. /docs)

42888.4k](/packages/harmbandstra-swagger-ui-bundle)[welp/mailchimp-bundle

MailChimp API V3 Symfony Bundle

45364.7k1](/packages/welp-mailchimp-bundle)[nilportugues/jsonapi-bundle

Symfony 2 &amp; 3 JSON API Transformer Package

11446.7k](/packages/nilportugues-jsonapi-bundle)[rekalogika/mapper

An object mapper for PHP and Symfony. Maps an object to another object. Primarily used for transforming an entity to a DTO and vice versa.

3853.2k1](/packages/rekalogika-mapper)[php-tmdb/symfony

Symfony Bundle for TMDB (The Movie Database) API. Provides easy access to the php-tmdb/api library.

3649.8k](/packages/php-tmdb-symfony)

PHPackages © 2026

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