From 6facbc0c71614a0b85039a83bea1751a40ab4c35 Mon Sep 17 00:00:00 2001 From: Adam Kadlec Date: Tue, 2 Jul 2024 23:06:44 +0200 Subject: [PATCH] Fixing interface --- src/Http/Request.php | 22 +++++++++++----------- src/Http/RequestFactory.php | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Http/Request.php b/src/Http/Request.php index e302353..6cb05b9 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -23,22 +23,22 @@ class Request extends Http\Request implements IRequest /** * @param Http\UrlScript $url - * @param array|null $post - * @param array|null $files - * @param array|null $cookies - * @param array|null $headers - * @param string|null $method + * @param array $post + * @param array $files + * @param array $cookies + * @param array $headers + * @param string $method * @param string|null $remoteAddress * @param string|null $remoteHost * @param null $rawBodyCallback */ public function __construct( Http\UrlScript $url, - ?array $post = null, - ?array $files = null, - ?array $cookies = null, - ?array $headers = null, - ?string $method = null, + array $post = [], + array $files = [], + array $cookies = [], + array $headers = [], + string $method = 'GET', ?string $remoteAddress = null, ?string $remoteHost = null, $rawBodyCallback = null @@ -67,7 +67,7 @@ public function getUrl(): Http\UrlScript /** * {@inheritdoc} */ - public function getQuery(?string $key = null) + public function getQuery(?string $key = null): mixed { if (func_num_args() === 0) { return $this->url->getQueryParameters(); diff --git a/src/Http/RequestFactory.php b/src/Http/RequestFactory.php index 459ac2c..27a4094 100644 --- a/src/Http/RequestFactory.php +++ b/src/Http/RequestFactory.php @@ -317,7 +317,7 @@ public function createHttpRequest(string $packet): ?IRequest unset($list, $key, $val, $k, $v); } - $request = new Request(new Http\UrlScript($url), null, null, $cookies, $headers, $method, $remoteAddr, $remoteHost, function () use ($rawBody): ?string { + $request = new Request(new Http\UrlScript($url), [], [], $cookies, $headers, $method, $remoteAddr, $remoteHost, function () use ($rawBody): ?string { return $rawBody; });