Skip to content

Commit

Permalink
merged 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 9, 2012
2 parents 617b330 + 9aea5e0 commit 9b175e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
8 changes: 5 additions & 3 deletions Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public function getUriForPath($path)
* It builds a normalized query string, where keys/value pairs are alphabetized
* and have consistent escaping.
*
* @return string A normalized query string for the Request
* @return string|null A normalized query string for the Request
*
* @api
*/
Expand Down Expand Up @@ -1054,15 +1054,15 @@ public function isNoCache()
*
* @param array $locales An array of ordered available locales
*
* @return string The preferred locale
* @return string|null The preferred locale
*
* @api
*/
public function getPreferredLanguage(array $locales = null)
{
$preferredLanguages = $this->getLanguages();

if (null === $locales) {
if (empty($locales)) {
return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null;
}

Expand Down Expand Up @@ -1168,6 +1168,8 @@ public function isXmlHttpRequest()
* Splits an Accept-* HTTP header.
*
* @param string $header Header to split
*
* @return array Array indexed by the values of the Accept-* header in preferred order
*/
public function splitHttpAcceptHeader($header)
{
Expand Down
34 changes: 17 additions & 17 deletions Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function send()
}

/**
* Sets the response content
* Sets the response content.
*
* Valid types are strings, numbers, and objects that implement a __toString() method.
*
Expand All @@ -263,7 +263,7 @@ public function setContent($content)
}

/**
* Gets the current response content
* Gets the current response content.
*
* @return string Content
*
Expand Down Expand Up @@ -299,7 +299,7 @@ public function getProtocolVersion()
}

/**
* Sets response status code.
* Sets the response status code.
*
* @param integer $code HTTP status code
* @param string $text HTTP status text
Expand All @@ -319,7 +319,7 @@ public function setStatusCode($code, $text = null)
}

/**
* Retrieves status code for the current web response.
* Retrieves the status code for the current web response.
*
* @return string Status code
*
Expand All @@ -331,7 +331,7 @@ public function getStatusCode()
}

/**
* Sets response charset.
* Sets the response charset.
*
* @param string $charset Character set
*
Expand Down Expand Up @@ -457,7 +457,7 @@ public function mustRevalidate()
*
* @return \DateTime A \DateTime instance
*
* @throws \RuntimeException when the header is not parseable
* @throws \RuntimeException When the header is not parseable
*
* @api
*/
Expand Down Expand Up @@ -518,7 +518,7 @@ public function getExpires()
}

/**
* Sets the Expires HTTP header with a \DateTime instance.
* Sets the Expires HTTP header with a DateTime instance.
*
* If passed a null value, it removes the header.
*
Expand Down Expand Up @@ -570,7 +570,7 @@ public function getMaxAge()
*
* This methods sets the Cache-Control max-age directive.
*
* @param integer $value A number of seconds
* @param integer $value Number of seconds
*
* @api
*/
Expand All @@ -584,7 +584,7 @@ public function setMaxAge($value)
*
* This methods sets the Cache-Control s-maxage directive.
*
* @param integer $value A number of seconds
* @param integer $value Number of seconds
*
* @api
*/
Expand Down Expand Up @@ -620,7 +620,7 @@ public function getTtl()
*
* This method adjusts the Cache-Control/s-maxage directive.
*
* @param integer $seconds The number of seconds
* @param integer $seconds Number of seconds
*
* @api
*/
Expand All @@ -634,7 +634,7 @@ public function setTtl($seconds)
*
* This method adjusts the Cache-Control/max-age directive.
*
* @param integer $seconds The number of seconds
* @param integer $seconds Number of seconds
*
* @api
*/
Expand All @@ -656,7 +656,7 @@ public function getLastModified()
}

/**
* Sets the Last-Modified HTTP header with a \DateTime instance.
* Sets the Last-Modified HTTP header with a DateTime instance.
*
* If passed a null value, it removes the header.
*
Expand All @@ -676,7 +676,7 @@ public function setLastModified(\DateTime $date = null)
}

/**
* Returns the literal value of ETag HTTP header.
* Returns the literal value of the ETag HTTP header.
*
* @return string The ETag HTTP header
*
Expand Down Expand Up @@ -709,7 +709,7 @@ public function setEtag($etag = null, $weak = false)
}

/**
* Sets Response cache headers (validation and/or expiration).
* Sets the response's cache headers (validation and/or expiration).
*
* Available options are: etag, last_modified, max_age, s_maxage, private, and public.
*
Expand Down Expand Up @@ -819,15 +819,15 @@ public function setVary($headers, $replace = true)
}

/**
* Determines if the Response validators (ETag, Last-Modified) matches
* Determines if the Response validators (ETag, Last-Modified) match
* a conditional value specified in the Request.
*
* If the Response is not modified, it sets the status code to 304 and
* remove the actual content by calling the setNotModified() method.
* removes the actual content by calling the setNotModified() method.
*
* @param Request $request A Request instance
*
* @return Boolean true if the Response validators matches the Request, false otherwise
* @return Boolean true if the Response validators match the Request, false otherwise
*
* @api
*/
Expand Down

0 comments on commit 9b175e6

Please sign in to comment.