diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-05-24 17:16:05 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-05-24 17:16:05 +0300 |
| commit | 6f660eedb640eaa31e75cfd2543692d7f494ddd6 (patch) | |
| tree | bf5a6d43ae77daf7a63d5c1770ec5dac6af5bc06 /classes/Request.php | |
| parent | 8ca1fb36999b0e2eceed1388d1a1f7cc115a2f3c (diff) | |
| download | the-epube-6f660eedb640eaa31e75cfd2543692d7f494ddd6.tar.gz the-epube-6f660eedb640eaa31e75cfd2543692d7f494ddd6.tar.xz | |
fix phpstan issues
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; |
