Permalink
Browse files

Added @link to all public functions there have documentation.

And correct a small 'typo'.
  • Loading branch information...
1 parent dbbd05d commit 46d3d8e48eab249bdbe3db643d776dcc63bd626d @kimegede kimegede committed Sep 1, 2013
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/Cake/Utility/Hash.php
View
@@ -38,6 +38,7 @@ class Hash {
* @param string|array $path The path being searched for. Either a dot
* separated string, or an array of path segments.
* @return mixed The value fetched from the array, or null.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::get
*/
public static function get(array $data, $path) {
if (empty($data)) {
@@ -85,6 +86,7 @@ public static function get(array $data, $path) {
* @param string $path The path to extract.
* @return array An array of the extracted values. Returns an empty array
* if there are no matches.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::extract
*/
public static function extract(array $data, $path) {
if (empty($path)) {
@@ -220,6 +222,7 @@ protected static function _matches(array $data, $selector) {
* @param string $path The path to insert at.
* @param array $values The values to insert.
* @return array The data with $values inserted.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::insert
*/
public static function insert(array $data, $path, $values = null) {
$tokens = explode('.', $path);
@@ -288,6 +291,7 @@ protected static function _simpleOp($op, $data, $path, $values = null) {
* @param array $data The data to operate on
* @param string $path A path expression to use to remove.
* @return array The modified array.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::remove
*/
public static function remove(array $data, $path) {
$tokens = explode('.', $path);
@@ -389,6 +393,7 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::format
* @see sprintf()
* @see Hash::extract()
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::format
*/
public static function format(array $data, array $paths, $format) {
$extracted = array();
@@ -466,6 +471,7 @@ public static function contains(array $data, array $needle) {
* @param string $path The path to check for.
* @return boolean Existence of path.
* @see Hash::extract()
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::check
*/
public static function check(array $data, $path) {
$results = self::extract($data, $path);
@@ -556,6 +562,7 @@ public static function flatten(array $data, $separator = '.') {
* @param array $data Flattened array
* @param string $separator The delimiter used
* @return array
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::expand
*/
public static function expand($data, $separator = '.') {
$result = array();
@@ -678,6 +685,7 @@ public static function maxDimensions(array $data) {
* @param string $path The path to extract for mapping over.
* @param callable $function The function to call on each extracted value.
* @return array An array of the modified values.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::map
*/
public static function map(array $data, $path, $function) {
$values = (array)self::extract($data, $path);
@@ -691,6 +699,7 @@ public static function map(array $data, $path, $function) {
* @param string $path The path to extract from $data.
* @param callable $function The function to call on each extracted value.
* @return mixed The reduced value.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::reduce
*/
public static function reduce(array $data, $path, $function) {
$values = (array)self::extract($data, $path);
@@ -858,11 +867,12 @@ public static function diff(array $data, $compare) {
}
/**
- * Merges the difference between $data and $push onto $data.
+ * Merges the difference between $data and $compare onto $data.
*
* @param array $data The data to append onto.
* @param array $compare The data to compare and append onto.
* @return array The merged array.
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::mergeDiff
*/
public static function mergeDiff(array $data, $compare) {
if (empty($data) && !empty($compare)) {
@@ -932,6 +942,7 @@ public static function normalize(array $data, $assoc = true) {
* @param array $options Options are:
* @return array of results, nested
* @see Hash::extract()
+ * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::nest
*/
public static function nest(array $data, $options = array()) {
if (!$data) {

0 comments on commit 46d3d8e

Please sign in to comment.