summaryrefslogtreecommitdiffstats
path: root/system/helpers/array_helper.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-04-27 17:47:35 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-04-27 17:47:35 +0200
commitfe11f14a62a5a761c790621c7c3f5a79d9d0c741 (patch)
treed34d5e987196bccd19684388e4f161c8a66269b5 /system/helpers/array_helper.php
parent2fbd57d6d58afd64caa841a876e9773272275526 (diff)
parent01b129a42b62fd08cd873f44ded026041b560420 (diff)
Merge pull request #1299 from timw4mail/patch
Fix helper docblocks
Diffstat (limited to 'system/helpers/array_helper.php')
-rw-r--r--system/helpers/array_helper.php56
1 files changed, 28 insertions, 28 deletions
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index 6f56d9db9..6a7c8e3c7 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -37,19 +37,19 @@
// ------------------------------------------------------------------------
-/**
- * Element
- *
- * Lets you determine whether an array index is set and whether it has a value.
- * If the element is empty it returns FALSE (or whatever you specify as the default value.)
- *
- * @param string
- * @param array
- * @param mixed
- * @return mixed depends on what the array contains
- */
if ( ! function_exists('element'))
{
+ /**
+ * Element
+ *
+ * Lets you determine whether an array index is set and whether it has a value.
+ * If the element is empty it returns FALSE (or whatever you specify as the default value.)
+ *
+ * @param string
+ * @param array
+ * @param mixed
+ * @return mixed depends on what the array contains
+ */
function element($item, $array, $default = FALSE)
{
return empty($array[$item]) ? $default : $array[$item];
@@ -58,14 +58,14 @@ if ( ! function_exists('element'))
// ------------------------------------------------------------------------
-/**
- * Random Element - Takes an array as input and returns a random element
- *
- * @param array
- * @return mixed depends on what the array contains
- */
if ( ! function_exists('random_element'))
{
+ /**
+ * Random Element - Takes an array as input and returns a random element
+ *
+ * @param array
+ * @return mixed depends on what the array contains
+ */
function random_element($array)
{
return is_array($array) ? $array[array_rand($array)] : $array;
@@ -74,19 +74,19 @@ if ( ! function_exists('random_element'))
// --------------------------------------------------------------------
-/**
- * Elements
- *
- * Returns only the array items specified. Will return a default value if
- * it is not set.
- *
- * @param array
- * @param array
- * @param mixed
- * @return mixed depends on what the array contains
- */
if ( ! function_exists('elements'))
{
+ /**
+ * Elements
+ *
+ * Returns only the array items specified. Will return a default value if
+ * it is not set.
+ *
+ * @param array
+ * @param array
+ * @param mixed
+ * @return mixed depends on what the array contains
+ */
function elements($items, $array, $default = FALSE)
{
$return = array();