Skip to content

Commit

Permalink
Update doc blocks for request methods and make getParam simpler.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 11, 2016
1 parent 3e6954c commit 5061c01
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Http/ServerRequest.php
Expand Up @@ -1402,7 +1402,7 @@ public function query($name = null)
/**
* Read a specific query value or dotted path.
*
* @param string $name The name of the query arg or a dotted path.
* @param string $name The name or dotted path to the query param.
* @param mixed $default The default value if the named parameter is not set.
* @return mixed Query data.
*/
Expand Down Expand Up @@ -1556,7 +1556,7 @@ public function cookie($key)
/**
* Read cookie data from the request's cookie data.
*
* @param string $key The key you want to read.
* @param string $key The key or dotted path you want to read.
* @param string $default The default value if the cookie is not set.
* @return null|string Either the cookie value, or null if the value doesn't exist.
*/
Expand Down Expand Up @@ -1793,17 +1793,13 @@ public function withParam($name, $value)
/**
* Safely access the values in $this->params.
*
* @param string $name The name of the parameter to get.
* @param string $name The name or dotted path to parameter.
* @param mixed $default The default value if $name is not set.
* @return mixed
*/
public function getParam($name, $default = false)
{
if (!isset($this->params[$name])) {
return Hash::get($this->params, $name, $default);
}

return $this->params[$name];
return Hash::get($this->params, $name, $default);
}

/**
Expand Down

0 comments on commit 5061c01

Please sign in to comment.