| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* Provides a collection of static methods for array manipulation.
}
/**
- * convert associative array names to values
+ * convert associative array names to values.
* and vice-versa.
*
* This function is used by both the web form layer and the api. Note that
* @param array $array
* (optional) Array to be checked for emptiness.
*
- * @return boolean
+ * @return bool
* True if the array is empty.
*/
public static function crmIsEmptyArray($array = array()) {
* @param array $items
* The array from which to remove items.
*
- * @internal param string|\string[] $key When passed a string, unsets $items[$key].* When passed a string, unsets $items[$key].
- * When passed an array of strings, unsets $items[$k] for each string $k
- * in the array.
+ * Additional params:
+ * When passed a string, unsets $items[$key].
+ * When passed an array of strings, unsets $items[$k] for each string $k in the array.
*/
public static function remove(&$items) {
foreach (func_get_args() as $n => $key) {
return $elementArray;
}
- /*
+ /**
* Searches array keys by regex, returning the value of the first match.
*
* Given a regular expression and an array, this method searches the keys
* @return mixed
* The value found.
*/
- /**
- * @param $regexKey
- * @param $list
- * @param null $default
- *
- * @return null
- */
public static function valueByRegexKey($regexKey, $list, $default = NULL) {
if (is_array($list) && $regexKey) {
$matches = preg_grep($regexKey, array_keys($list));
* @return array
* Each item is a distinct combination of values from $dimensions.
*
- * For example, the product of
- * {
+ * For example, the product of
+ * {
* fg => {red, blue},
* bg => {white, black}
- * }
- * would be
- * {
+ * }
+ * would be
+ * {
* {fg => red, bg => white},
* {fg => red, bg => black},
* {fg => blue, bg => white},
* {fg => blue, bg => black}
- * }
+ * }
*/
public static function product($dimensions, $template = array()) {
if (empty($dimensions)) {
}
/**
- * Get the first element of an array
+ * Get the first element of an array.
*
* @param array $array
* @return mixed|NULL
}
return $output;
}
+
}