Bridges between Symfony HttpKernel and HTTP Message Strategies (PSR pre-Draft)
Those adapters are built on top of the existing symfony/psr-http-message-bridge that bridges Symfony and PSR-7 HTTP messages.
This bridge is currently based on Common interfaces for HTTP Message Strategies. As this is in an early stage, this might be subject to change!
By default, the Symfony HttpFoundation and HttpKernel are used. For PSR-7, the Zend-Diactoros implementation is used. These implementations can be changed if needed.
// Use the HttpInteropToSymfonyBridge adapter
$requestHandlerStrategy = new HttpInteropToSymfonyBridge($yourHttpKernel);
// Handling PSR-7 requests
$psr7Response = $requestHandlerStrategy($psr7Request);
// Use the SymfonyToHttpInteropBridge adapter
$symfonyKernel = new SymfonyToHttpInteropBridge($yourServerRequestHandler);
// Handling Symfony requests
$symfonyResponse = $symfonyKernel->handle($symfonyRequest);