diff options
Diffstat (limited to 'classes/Request.php')
| -rw-r--r-- | classes/Request.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/classes/Request.php b/classes/Request.php index 57fe862..b3d2b62 100644 --- a/classes/Request.php +++ b/classes/Request.php @@ -2,34 +2,42 @@ class Request { + /** @var array<string, mixed> */ private array $serverParams; + /** @var array<string, mixed> */ private array $queryParams; + /** @var array<string, mixed> */ private array $bodyParams; + /** @var array<string, mixed> */ private array $cookies; public function __construct() { - $this->serverParams = $_SERVER ?? []; - $this->queryParams = $_GET ?? []; - $this->bodyParams = $_POST ?? []; - $this->cookies = $_COOKIE ?? []; + $this->serverParams = $_SERVER; + $this->queryParams = $_GET; + $this->bodyParams = $_POST; + $this->cookies = $_COOKIE; } + /** @return array<string, mixed> */ public function getServerParams(): array { return $this->serverParams; } + /** @return array<string, mixed> */ public function getQueryParams(): array { return $this->queryParams; } + /** @return array<string, mixed> */ public function getParsedBody(): array { return array_merge($this->queryParams, $this->bodyParams); } + /** @return array<string, mixed> */ public function getCookieParams(): array { return $this->cookies; |
