Navigation Menu

Skip to content

Commit

Permalink
Added @link to all public functions there have documentation.
Browse files Browse the repository at this point in the history
And correct a small 'typo'.
  • Loading branch information
kimegede committed Sep 1, 2013
1 parent dbbd05d commit 46d3d8e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/Cake/Utility/Hash.php
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 46d3d8e

Please sign in to comment.