Permalink
Browse files

Clarifying some Set documentation. Removing deprecated &get() method.

  • Loading branch information...
1 parent 1a4f806 commit f231b59cfb737908dcabc74b463a5d8f6f37c0ee @jperras jperras committed Sep 25, 2009
Showing with 8 additions and 14 deletions.
  1. +8 −14 cake/libs/set.php
View
@@ -373,8 +373,8 @@ function format($data, $format, $keys) {
* Bugs as you find them. Suggestions for additional features to imlement are also very welcome!
*
* @param string $path An absolute XPath 2.0 path
- * @param string $data An array of data to extract from
- * @param string $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
+ * @param array $data An array of data to extract from
+ * @param array $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
* @return array An array of matched items
* @access public
* @static
@@ -1141,14 +1141,16 @@ function sort($data, $path, $dir) {
* Allows the application of a callback method to elements of an
* array extracted by a Set::extract() compatible path.
*
- * @param string $path A Set-compatible path to the array value
- * @param array $data
+ * @param mixed $path Set-compatible path to the array value
+ * @param array $data An array of data to extract from & then process with the $callback.
* @param mixed $callback Callback method to be applied to extracted data.
* See http://ca2.php.net/manual/en/language.pseudo-types.php#language.types.callback for examples
* of callback formats.
- * @param array $options
+ * @param array $options Options are:
+ * - type : can be pass, map, or reduce. Map will handoff the given callback
+ * to array_map, reduce will handoff to array_reduce, and pass will
+ * use call_user_func_array().
* @return mixed Result of the callback when applied to extracted data
- *
*/
function apply($path, $data, $callback, $options = array()) {
$defaults = array('type' => 'pass');
@@ -1170,13 +1172,5 @@ function apply($path, $data, $callback, $options = array()) {
return $result;
}
-
-/**
- * Deprecated, Set class should be called statically
- *
- */
- function &get() {
- trigger_error('get() is deprecated. Set class should be called statically', E_USER_WARNING);
- }
}
?>

0 comments on commit f231b59

Please sign in to comment.