public function HttpFoundationFactory::createRequest 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::createRequest()
Creates a Symfony Request instance from a PSR-7 one.
Parameters
ServerRequestInterface $psrRequest:
Return value
Overrides HttpFoundationFactoryInterface::createRequest
File
- vendor/
symfony/ psr-http-message-bridge/ Factory/ HttpFoundationFactory.php, line 33
Class
- HttpFoundationFactory
- @author Kévin Dunglas <dunglas@gmail.com>
Namespace
Symfony\Bridge\PsrHttpMessage\FactoryCode
public function createRequest(ServerRequestInterface $psrRequest) {
$parsedBody = $psrRequest
->getParsedBody();
$parsedBody = is_array($parsedBody) ? $parsedBody : array();
$request = new Request($psrRequest
->getQueryParams(), $parsedBody, $psrRequest
->getAttributes(), $psrRequest
->getCookieParams(), $this
->getFiles($psrRequest
->getUploadedFiles()), $psrRequest
->getServerParams(), $psrRequest
->getBody()
->__toString());
$request->headers
->replace($psrRequest
->getHeaders());
return $request;
}