Skip to content

Commit

Permalink
update file
Browse files Browse the repository at this point in the history
  • Loading branch information
juancristobalgd1 authored May 25, 2024
1 parent 10bc9c7 commit cc2393f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/libraries/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public function getClientOriginalExtension()
{
$file = data_get($this->files(), 'file');
$extension = pathinfo($file, PATHINFO_EXTENSION);

return $extension;
}

Expand Down Expand Up @@ -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.");
}
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand All @@ -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 = '')
{
Expand All @@ -559,7 +554,6 @@ public function request(string $key = '')

/**
* Gets a value $value from the array $_SERVER
* @return mixed
*/
protected function server(string $key = '')
{
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit cc2393f

Please sign in to comment.