diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-05 14:59:13 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-05 14:59:13 +0000 |
commit | 4d7dff992d7aef6775744f91ce2766d164f4a5da (patch) | |
tree | de2e7c8d30e8ef7b9ac5865625ab308ff3c104d9 /src/PSR7Client.php | |
parent | 670a6de77a0aee53296ac8741853cbec1b416f8d (diff) | |
parent | 1ca2cd491bc0f70aa2893c7e39e0389345a7728b (diff) |
Merge #318v1.8.0
318: release 1.8.0 r=48d90782 a=48d90782
release 1.8.0
Co-authored-by: Valery Piashchynski <[email protected]>
Co-authored-by: Valentin V / vvval <[email protected]>
Diffstat (limited to 'src/PSR7Client.php')
-rw-r--r-- | src/PSR7Client.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/PSR7Client.php b/src/PSR7Client.php index 98897890..777dd891 100644 --- a/src/PSR7Client.php +++ b/src/PSR7Client.php @@ -10,11 +10,11 @@ declare(strict_types=1); namespace Spiral\RoadRunner; use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\UploadedFileInterface; use Psr\Http\Message\ServerRequestFactoryInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\UploadedFileFactoryInterface; +use Psr\Http\Message\UploadedFileInterface; /** * Manages PSR-7 request and response. @@ -69,7 +69,7 @@ class PSR7Client /** * @return ServerRequestInterface|null */ - public function acceptRequest() + public function acceptRequest(): ?ServerRequestInterface { $rawRequest = $this->httpClient->acceptRequest(); if ($rawRequest === null) { @@ -101,11 +101,11 @@ class PSR7Client } if ($rawRequest['ctx']['parsed']) { - $request = $request->withParsedBody(json_decode($rawRequest['body'], true)); - } else { - if ($rawRequest['body'] !== null) { - $request = $request->withBody($this->streamFactory->createStream($rawRequest['body'])); - } + return $request->withParsedBody(json_decode($rawRequest['body'], true)); + } + + if ($rawRequest['body'] !== null) { + return $request->withBody($this->streamFactory->createStream($rawRequest['body'])); } return $request; |