Skip to content

Commit

Permalink
Merge pull request #12 from adinan-cenci/issue-11/get-does-not-return…
Browse files Browse the repository at this point in the history
…-default-value

issue-11: ServerRequest::get() does not return the specified default value
  • Loading branch information
adinan-cenci authored Apr 21, 2024
2 parents c148ca6 + 3a33554 commit db1dfa7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function get(string $name, $default = null)
{
return isset($this->queryParams[$name])
? $this->queryParams[$name]
: null;
: $default;
}

/**
Expand All @@ -167,9 +167,9 @@ public function get(string $name, $default = null)
*/
public function cookie(string $name, $default = null)
{
return isset($this->queryParams[$name])
? $this->queryParams[$name]
: null;
return isset($this->cookieParams[$name])
? $this->cookieParams[$name]
: $default;
}

/**
Expand All @@ -187,7 +187,7 @@ public function server(string $name, $default = null)
{
return isset($this->serverParams[$name])
? $this->serverParams[$name]
: null;
: $default;
}

protected static function getMime(string $contentType) : string
Expand Down

0 comments on commit db1dfa7

Please sign in to comment.