PHPackages                             loophp/psr-http-message-bridge-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. loophp/psr-http-message-bridge-bundle

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

loophp/psr-http-message-bridge-bundle
=====================================

Register symfony/psr-http-message-bridge classes in your Symfony application.

1.3.0(1mo ago)399.7k↑12.6%1[5 PRs](https://github.com/loophp/psr-http-message-bridge-bundle/pulls)3MITPHPPHP &gt;= 8.4CI passing

Since Jul 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/loophp/psr-http-message-bridge-bundle)[ Packagist](https://packagist.org/packages/loophp/psr-http-message-bridge-bundle)[ Docs](http://github.com/loophp/psr-http-message-bridge-bundle)[ GitHub Sponsors](https://github.com/drupol)[ RSS](/packages/loophp-psr-http-message-bridge-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (13)Used By (3)

[![Latest Stable Version](https://camo.githubusercontent.com/5d79451e167c3f29e8051be9020a713df0b82c9b4b4eb275f56e387ebb95b238/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f6f7068702f7073722d687474702d6d6573736167652d6272696467652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/psr-http-message-bridge-bundle)[![GitHub stars](https://camo.githubusercontent.com/52741e4a34c89ca87f9b617c0f7b8c102021e0d060e6daa64fc8262476311374/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6c6f6f7068702f7073722d687474702d6d6573736167652d6272696467652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/psr-http-message-bridge-bundle)[![Total Downloads](https://camo.githubusercontent.com/82cb71b7e26e07eb626ca3a3094418de00d79c6df52dc5b0e4035312b052778d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f6f7068702f7073722d687474702d6d6573736167652d6272696467652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/psr-http-message-bridge-bundle)[![License](https://camo.githubusercontent.com/efdc5f1a830d7234105282f5b85dc42e17073193943b6fba75df4da932d17efd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f6f7068702f7073722d687474702d6d6573736167652d6272696467652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/psr-http-message-bridge-bundle)[![Donate!](https://camo.githubusercontent.com/a71f45de7e408be2477113d166e9ee94c90bbf814a1373fd154aa5b6652302de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d4769746875622d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/sponsors/drupol)

PSR HTTP Message Bridge Bundle
==============================

[](#psr-http-message-bridge-bundle)

This bundle will register in your Symfony application's container a couple of services.

Those services are from the [symfony/psr-http-message-brige](https://github.com/symfony/psr-http-message-bridge) bridge package.

It provides:

- An argument value resolver to be able to get the following objects through:

    - `Psr\Http\Message\MessageInterface`
    - `Psr\Http\Message\RequestInterface`
    - `Psr\Http\Message\ServerRequestInterface`

    Those are directly derived from the current Symfony Request object.

    It means that you can directly get a PSR7 Request in Symfony controllers through method parameters.
- An event listener that let users return PSR7 Responses in Symfony controllers. Basically, this event will check if the return value of a Response is an instance of `Psr\Http\Message\ResponseInterface` and only if it's the case, will convert it into a Symfony response.
- Factories:

    - A `HttpFoundactionFactory` service to convert PSR requests into Symfony requests.
    - A `PsrHttpFactory` service to convert Symfony requests into PSR requests.

Requirements
============

[](#requirements)

- PHP &gt;= 7.3
- Symfony &gt;= 4

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

[](#installation)

```
composer require loophp/psr-http-message-bridge-bundle
```

Once the bundle installed in your application, it's ready to use, there is no configuration to set up.

Usage
=====

[](#usage)

```
