From cc2393f3715a04060cd025b2c9d1130327300042 Mon Sep 17 00:00:00 2001 From: Juan Cristobal <65052633+juancristobalgd1@users.noreply.github.com> Date: Sat, 25 May 2024 06:56:24 +0200 Subject: [PATCH] update file --- src/libraries/Http/Request.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/libraries/Http/Request.php b/src/libraries/Http/Request.php index 496d576..089e343 100644 --- a/src/libraries/Http/Request.php +++ b/src/libraries/Http/Request.php @@ -137,6 +137,7 @@ public function getClientOriginalExtension() { $file = data_get($this->files(), 'file'); $extension = pathinfo($file, PATHINFO_EXTENSION); + return $extension; } @@ -251,7 +252,7 @@ public function isXml(): bool private function hasPost(): bool { if ($this->is_csrf_valid()) - return ($this->isPost()) ? true : false; + return $this->isPost(); else return throw new RuntimeException("CSRF token is invalid."); } @@ -291,8 +292,6 @@ public function parseForm(string $input): array /** * Convert an array to an object, containing only the provided keys with values. - * - * @param array $keys */ protected function arrayToObject(array $keys): object { @@ -444,7 +443,7 @@ public function getHttpVersion(): float /** * Modify the parameter passed by Url */ - public function setRouteParams($params) + public function setRouteParams($params): self { $this->routeParams = $params; return $this; @@ -516,9 +515,6 @@ public function getContentType(): ?string /** * Check the method of the request - * - * @param string $method Http method - * @return mixed */ public function isRequestMethod(string|array $methods): bool { @@ -542,7 +538,6 @@ public function post(string $key = '') /** * Gets a value from the $_GET array, applies the default FILTER_SANITIZE_STRING filter - * @return mixed */ public function get(string $key = '') { @@ -559,7 +554,6 @@ public function request(string $key = '') /** * Gets a value $value from the array $_SERVER - * @return mixed */ protected function server(string $key = '') { @@ -701,7 +695,7 @@ public function getHeaders(): array /** * Returns the value of the header by entering the key */ - public function getHeader(string $key): array|string|null + public function getHeader(string $key): array|string|null { return $this->getHeaders()[$key] ?? null; }