added missing method's docblock

This commit is contained in:
Brikou CARRE 2011-05-22 09:13:03 +02:00
parent ac1bde9003
commit e018e6ce44

View File

@ -326,6 +326,11 @@ class Request
return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep); return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep);
} }
/**
* Gets the Session.
*
* @return Session|null The session
*/
public function getSession() public function getSession()
{ {
return $this->session; return $this->session;
@ -353,6 +358,11 @@ class Request
return null !== $this->session; return null !== $this->session;
} }
/**
* Sets the Session.
*
* @param Session $session The Session
*/
public function setSession(Session $session) public function setSession(Session $session)
{ {
$this->session = $session; $this->session = $session;
@ -449,11 +459,21 @@ class Request
return $this->baseUrl; return $this->baseUrl;
} }
/**
* Gets the request's scheme.
*
* @return string
*/
public function getScheme() public function getScheme()
{ {
return $this->isSecure() ? 'https' : 'http'; return $this->isSecure() ? 'https' : 'http';
} }
/**
* Returns the port on which the request is made.
*
* @return string
*/
public function getPort() public function getPort()
{ {
return $this->headers->get('X-Forwarded-Port') ?: $this->server->get('SERVER_PORT'); return $this->headers->get('X-Forwarded-Port') ?: $this->server->get('SERVER_PORT');
@ -480,6 +500,11 @@ class Request
return $name.':'.$port; return $name.':'.$port;
} }
/**
* Returns the requested URI.
*
* @return string
*/
public function getRequestUri() public function getRequestUri()
{ {
if (null === $this->requestUri) { if (null === $this->requestUri) {
@ -550,6 +575,11 @@ class Request
return implode('&', $parts); return implode('&', $parts);
} }
/**
* Checks whether the request is secure or not.
*
* @return Boolean
*/
public function isSecure() public function isSecure()
{ {
return ( return (
@ -586,6 +616,11 @@ class Request
return trim($host); return trim($host);
} }
/**
* Sets the request method.
*
* @param string $method
*/
public function setMethod($method) public function setMethod($method)
{ {
$this->method = null; $this->method = null;
@ -689,6 +724,11 @@ class Request
$this->format = $format; $this->format = $format;
} }
/**
* Checks whether the method is safe or not.
*
* @return Boolean
*/
public function isMethodSafe() public function isMethodSafe()
{ {
return in_array($this->getMethod(), array('GET', 'HEAD')); return in_array($this->getMethod(), array('GET', 'HEAD'));
@ -720,11 +760,21 @@ class Request
return $this->content; return $this->content;
} }
/**
* Gets the Etags.
*
* @return array The entity tags
*/
public function getETags() public function getETags()
{ {
return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY);
} }
/**
* Whether the cache is disabled.
*
* @return Boolean
*/
public function isNoCache() public function isNoCache()
{ {
return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma'); return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma');