Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Gt\Http;

use Gt\Http\Header\RequestHeaders;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UriInterface;

class RequestFactory {
Expand All @@ -22,13 +23,14 @@ public function createServerRequestFromGlobalState(
array $get,
array $post,
string $inputPath = "php://input"
):Request {
):ServerRequestInterface {
$method = $server["REQUEST_METHOD"] ?? "";
$uri = $this->buildUri($server);

$headers = $this->buildRequestHeaders($server);

return $this->buildRequest(
/** @var ServerRequestInterface $serverRequest */
$serverRequest = $this->buildRequest(
$method,
$uri,
$headers,
Expand All @@ -38,6 +40,7 @@ public function createServerRequestFromGlobalState(
$post,
$inputPath
);
return $serverRequest;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ public function formData():Promise {
*
* Note: if no Async loop is set up, the returned Promise will resolve in a blocking way, always being
* resolved or rejected. See https://www.php.gt/fetch for a complete async implementation.
*
* @param int<1, max> $depth
*/
public function json(int $depth = 512, int $options = 0):Promise {
$promise = $this->getPromise();
Expand Down