{"id":18929508,"url":"https://github.com/thecodingmachine/symfony-psr15-bridge","last_synced_at":"2025-04-15T15:31:05.756Z","repository":{"id":49223126,"uuid":"74590484","full_name":"thecodingmachine/symfony-psr15-bridge","owner":"thecodingmachine","description":"A bridge between Symfony middlewares (StackPHP) and http-interop middlewares for converting Symfony Http abstractions to PSR-15 and back.","archived":false,"fork":false,"pushed_at":"2021-06-22T23:28:34.000Z","size":23,"stargazers_count":16,"open_issues_count":3,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-11T18:59:51.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-23T15:40:17.000Z","updated_at":"2024-01-10T20:26:44.000Z","dependencies_parsed_at":"2022-08-19T02:51:42.319Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/symfony-psr15-bridge","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsymfony-psr15-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsymfony-psr15-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsymfony-psr15-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsymfony-psr15-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/symfony-psr15-bridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249097870,"owners_count":21212364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:33:08.185Z","updated_at":"2025-04-15T15:31:05.487Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thecodingmachine/symfony-psr15-bridge\n\nBridges between [Symfony HttpKernel](http://symfony.com/doc/current/components/http_kernel/introduction.html) (a.k.a. [StackPHP Middleware](http://stackphp.com/)) and [PSR-15 middlewares](https://www.php-fig.org/psr/psr-15/).\n\n\n[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/symfony-psr15-bridge/v/stable)](https://packagist.org/packages/thecodingmachine/symfony-psr15-bridge)\n[![Total Downloads](https://poser.pugx.org/thecodingmachine/symfony-psr15-bridge/downloads)](https://packagist.org/packages/thecodingmachine/symfony-psr15-bridge)\n[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/symfony-psr15-bridge/v/unstable)](https://packagist.org/packages/thecodingmachine/symfony-psr15-bridge)\n[![License](https://poser.pugx.org/thecodingmachine/symfony-psr15-bridge/license)](https://packagist.org/packages/thecodingmachine/symfony-psr15-bridge)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/symfony-psr15-bridge/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/thecodingmachine/symfony-psr15-bridge/?branch=master)\n[![Build Status](https://travis-ci.org/thecodingmachine/symfony-psr15-bridge.svg?branch=master)](https://travis-ci.org/thecodingmachine/symfony-psr15-bridge)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/symfony-psr15-bridge/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/thecodingmachine/symfony-psr15-bridge?branch=master)\n\nThose adapters are built on top of the existing [symfony/psr-http-message-bridge](https://github.com/symfony/psr-http-message-bridge) that bridges Symfony and PSR-7 HTTP messages.\n\n## Installation\n\nThe recommended way to install symfony-psr15-bridge is through [Composer](http://getcomposer.org/):\n\n```sh\ncomposer require thecodingmachine/symfony-psr15-bridge\n```\n\n## Usage\n\nBy default, the Symfony HttpFoundation and HttpKernel are used.\nFor PSR-7, the [Zend-Diactoros](https://github.com/zendframework/zend-diactoros) implementation is used.\nThese implementations can be changed if needed.\n\n### Wrapping a HttpKernel\n\n```php\n\u003c?php\n\n// Use the Psr15ToSymfonyBridge adapter\n$psr15Middleware = new Psr15ToSymfonyBridge($yourHttpKernel);\n\n// Handling PSR-7 requests\n$psr7Response = $psr15Middleware-\u003eprocess($psr7Request, $dummyNextPsr7Middleware);\n```\n\n**Important:** Symfony Http Kernels do not have the notion of \"next\" middlewares. Therefore, the \"next\" PSR-7 middleware\nyou pass to the `process` method will never be called.\n\n### Wrapping a PSR-7 callback\n\n\n```php\n\u003c?php\n\n// Use the Psr15ToSymfonyBridge adapter\n$symfonyKernel = new SymfonyToPsr15Bridge($nextSymfonyMiddleware, $yourPsr15Middleware);\n\n// Handling Symfony requests\n$symfonyResponse = $symfonyKernel-\u003ehandle($symfonyRequest);\n```\n\nNote: the adapter's constructor takes 2 middlewares: the \"next\" Symfony middleware that will be called by the \"delegate\"\npsr15 feature and the psr15 middleware to be wrapped.\n\n## Other known middleware adapters\n\nI initially planned to submit this project as a PR to [h4cc/stack-psr7-bridge](https://github.com/h4cc/stack-psr7-bridge/) (that was developed before the notion of \"PSR-7 middleware\" was standardized in http-interop that was itself the precursor to PSR-15).\nI soon realized that this was in fact a complete rewrite so I decided to create a new project for it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fsymfony-psr15-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fsymfony-psr15-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fsymfony-psr15-bridge/lists"}