public function HttpFoundationFactory::createResponse in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php \Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory::createResponse()
Creates a Symfony Response instance from a PSR-7 one.
Parameters
ResponseInterface $psrResponse:
Return value
Overrides HttpFoundationFactoryInterface::createResponse
File
- vendor/
symfony/ psr-http-message-bridge/ Factory/ HttpFoundationFactory.php, line 111
Class
- HttpFoundationFactory
- @author Kévin Dunglas <dunglas@gmail.com>
Namespace
Symfony\Bridge\PsrHttpMessage\FactoryCode
public function createResponse(ResponseInterface $psrResponse) {
$response = new Response($psrResponse
->getBody()
->__toString(), $psrResponse
->getStatusCode(), $psrResponse
->getHeaders());
$response
->setProtocolVersion($psrResponse
->getProtocolVersion());
foreach ($psrResponse
->getHeader('Set-Cookie') as $cookie) {
$response->headers
->setCookie($this
->createCookie($cookie));
}
return $response;
}