Permalink
Browse files

Updating and correct doc blocks for lib classes.

Removing unused private property in Router.
  • Loading branch information...
1 parent 38eac37 commit 134ce68dced65b673998a9f042957acef16ec621 @markstory markstory committed Jan 25, 2010
Showing with 122 additions and 77 deletions.
  1. +5 −5 cake/libs/i18n.php
  2. +12 −7 cake/libs/inflector.php
  3. +7 −4 cake/libs/l10n.php
  4. +11 −7 cake/libs/object.php
  5. +72 −39 cake/libs/router.php
  6. +2 −2 cake/libs/security.php
  7. +9 −10 cake/libs/set.php
  8. +4 −3 cake/libs/string.php
View
@@ -24,7 +24,7 @@
App::import('Core', 'l10n');
/**
- * Short description for file.
+ * I18n handles translation of Text and time format strings.
*
* @package cake
* @subpackage cake.cake.libs
@@ -120,10 +120,10 @@ function &getInstance() {
*
* @param string $singular String to translate
* @param string $plural Plural string (if any)
- * @param string $domain Domain
- * @param string $category Category
- * @param integer $count Count
- * @return string translated strings.
+ * @param string $domain Domain The domain of the translation. Domains are often used by plugin translations
+ * @param string $category Category The integer value of the category to use.
+ * @param integer $count Count Count is used with $plural to choose the correct plural form.
+ * @return string translated string.
* @access public
*/
function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) {
View
@@ -269,14 +269,19 @@ function _cache($type, $key, $value = false) {
/**
* Adds custom inflection $rules, of either 'plural' or 'singular' $type.
*
+ * ### Usage:
+ *
+ * {{{
+ * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables'));
+ * Inflector::rules('plural', array(
+ * 'rules' => array('/^(inflect)ors$/i' => '\1ables'),
+ * 'uninflected' => array('dontinflectme'),
+ * 'irregular' => array('red' => 'redlings')
+ * ));
+ * }}}
+ *
* @param string $type The type of inflection, either 'singular' or 'plural'
- * @param array $rules Array of rules to be added. Example usage:
- * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables'));
- * Inflector::rules('plural', array(
- * 'rules' => array('/^(inflect)ors$/i' => '\1ables'),
- * 'uninflected' => array('dontinflectme'),
- * 'irregular' => array('red' => 'redlings')
- * ));
+ * @param array $rules Array of rules to be added.
* @param boolean $reset If true, will unset default inflections for all
* new rules that are being defined in $rules.
* @access public
View
@@ -336,8 +336,8 @@ function __construct() {
/**
* Gets the settings for $language.
- * If $language is null it attempt to get settings from I10n::__autoLanguage(); if this fails
- * the method will get the settings from I10n::__setLanguage();
+ * If $language is null it attempt to get settings from L10n::__autoLanguage(); if this fails
+ * the method will get the settings from L10n::__setLanguage();
*
* @param string $language Language (if null will use DEFAULT_LANGUAGE if defined)
* @access public
@@ -432,7 +432,8 @@ function __autoLanguage() {
* Attempts to find locale for language, or language for locale
*
* @param mixed $mixed 2/3 char string (language/locale), array of those strings, or null
- * @return mixed string language/locale, array of those values, whole map as an array, or false when language/locale doesn't exist
+ * @return mixed string language/locale, array of those values, whole map as an array,
+ * or false when language/locale doesn't exist
* @access public
*/
function map($mixed = null) {
@@ -459,7 +460,9 @@ function map($mixed = null) {
* Attempts to find catalog record for requested language
*
* @param mixed $language string requested language, array of requested languages, or null for whole catalog
- * @return mixed array catalog record for requested language, array of catalog records, whole catalog, or false when language doesn't exist
+ * @return mixed array catalog record for requested language, array of catalog records, whole catalog,
+ * or false when language doesn't exist
+ * @access public
*/
function catalog($language = null) {
if (is_array($language)) {
View
@@ -67,12 +67,14 @@ function toString() {
}
/**
- * Calls a controller's method from any location.
+ * Calls a controller's method from any location. Can be used to connect controllers together
+ * or tie plugins into a main application. requestAction can be used to return rendered views
+ * or fetch the return value from controller actions.
*
* @param mixed $url String or array-based url.
* @param array $extra if array includes the key "return" it sets the AutoRender to true.
* @return mixed Boolean true or false on success/failure, or contents
- * of rendered action if 'return' is set in $extra.
+ * of rendered action if 'return' is set in $extra.
* @access public
*/
function requestAction($url, $extra = array()) {
@@ -95,8 +97,7 @@ function requestAction($url, $extra = array()) {
/**
* Calls a method on this object with the given parameters. Provides an OO wrapper
- * for call_user_func_array, and improves performance by using straight method calls
- * in most cases.
+ * for `call_user_func_array`
*
* @param string $method Name of the method to call
* @param array $params Parameter list to use when calling $method
@@ -124,7 +125,8 @@ function dispatchMethod($method, $params = array()) {
}
/**
- * Stop execution of the current script
+ * Stop execution of the current script. Wraps exit() making
+ * testing easier.
*
* @param $status see http://php.net/exit for values
* @return void
@@ -135,7 +137,8 @@ function _stop($status = 0) {
}
/**
- * API for logging events.
+ * Convience method to write a message to CakeLog. See CakeLog::write()
+ * for more information on writing to logs.
*
* @param string $msg Log message
* @param integer $type Error type constant. Defined in app/config/core.php.
@@ -153,7 +156,8 @@ function log($msg, $type = LOG_ERROR) {
}
/**
- * Allows setting of multiple properties of the object in a single line of code.
+ * Allows setting of multiple properties of the object in a single line of code. Will only set
+ * properties that are part of a class declaration.
*
* @param array $properties An associative array containing properties and corresponding values.
* @return void
Oops, something went wrong.

0 comments on commit 134ce68

Please sign in to comment.