Skip to content

Commit

Permalink
Format and document.
Browse files Browse the repository at this point in the history
- Format example indentation.
- Document null return type when negotiating fails.
- Fix example.
  • Loading branch information
mariuswilms committed Mar 28, 2015
1 parent b42d837 commit 7e60656
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions g11n/Locale.php
Expand Up @@ -62,8 +62,8 @@ class Locale extends \lithium\core\StaticObject {
* methods to parse and retrieve individual tags from a locale.
*
* ```
* Locale::language('en_US'); // returns 'en'
* Locale::territory('en_US'); // returns 'US'
* Locale::language('en_US'); // returns 'en'
* Locale::territory('en_US'); // returns 'US'
* ```
*
* @see lithium\g11n\Locale::$_tags
Expand Down
6 changes: 4 additions & 2 deletions net/http/Media.php
Expand Up @@ -176,7 +176,7 @@ public static function to($format, $data, array $options = array()) {
* use the same template(s) or other settings. Therefore, when serving JSONP content, you
* can specify that the extension defined in the type must be present in the URL:
* ```
* Media::type('jsonp', array('text/html'), array(
* Media::type('jsonp', array('application/json'), array(
* // template settings...
* 'conditions' => array('type' => true)
* ));
Expand Down Expand Up @@ -286,7 +286,8 @@ public static function type($type, $content = null, array $options = array()) {
* @see lithium\action\Request
* @param \lithium\action\Request $request The request which contains the details of
* the request to be content-negotiated.
* @return string Returns the first matching type name, i.e. `'html'` or `'json'`.
* @return string|null Returns the first matching type name, i.e. `'html'` or `'json'`. When
* no matching type is found returns `null`.
*/
public static function negotiate($request) {
$self = get_called_class();
Expand Down Expand Up @@ -851,6 +852,7 @@ protected static function _handle($handler, $data, &$response) {
* Helper method for listing registered media types. Returns all types, or a single
* content type if a specific type is specified.
*
* @todo Use fnmatch() to support wildcards.
* @param string $type Type to return.
* @return mixed Array of types, or single type requested.
*/
Expand Down

0 comments on commit 7e60656

Please sign in to comment.