summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-26 20:50:00 +0200
committerAndrey Andreev <narf@bofh.bg>2012-03-26 20:50:00 +0200
commit84c3b27fface58ecfcd0acf7172d3ee2043b3673 (patch)
tree11219b9ca72c9956395e890a34bec83655c4ec64 /system/helpers
parentb2518645404fcafa17f4cfcb8689dce845c90b75 (diff)
Remove access description lines and cleanup the string and typography helpers
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/string_helper.php41
-rw-r--r--system/helpers/typography_helper.php8
2 files changed, 17 insertions, 32 deletions
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index c61b26592..aed35c157 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter String Helpers
*
@@ -50,7 +48,6 @@
*
* this/that/theother
*
- * @access public
* @param string
* @return string
*/
@@ -69,7 +66,6 @@ if ( ! function_exists('trim_slashes'))
*
* Removes slashes contained in a string or in an array
*
- * @access public
* @param mixed string or array
* @return mixed string or array
*/
@@ -100,7 +96,6 @@ if ( ! function_exists('strip_slashes'))
*
* Removes single and double quotes from a string
*
- * @access public
* @param string
* @return string
*/
@@ -119,7 +114,6 @@ if ( ! function_exists('strip_quotes'))
*
* Converts single and double quotes to entities
*
- * @access public
* @param string
* @return string
*/
@@ -145,7 +139,6 @@ if ( ! function_exists('quotes_to_entities'))
*
* http://www.some-site.com/index.php
*
- * @access public
* @param string
* @return string
*/
@@ -153,7 +146,7 @@ if ( ! function_exists('reduce_double_slashes'))
{
function reduce_double_slashes($str)
{
- return preg_replace("#(^|[^:])//+#", "\\1/", $str);
+ return preg_replace('#(^|[^:])//+#', '\\1/', $str);
}
}
@@ -170,7 +163,6 @@ if ( ! function_exists('reduce_double_slashes'))
*
* Fred, Bill, Joe, Jimmy
*
- * @access public
* @param string
* @param string the character you wish to reduce
* @param bool TRUE/FALSE - whether to trim the character from the beginning/end
@@ -184,7 +176,7 @@ if ( ! function_exists('reduce_multiples'))
if ($trim === TRUE)
{
- $str = trim($str, $character);
+ return trim($str, $character);
}
return $str;
@@ -198,9 +190,8 @@ if ( ! function_exists('reduce_multiples'))
*
* Useful for generating passwords or hashes.
*
- * @access public
* @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
- * @param integer number of characters
+ * @param int number of characters
* @return string
*/
if ( ! function_exists('random_string'))
@@ -254,16 +245,19 @@ if ( ! function_exists('random_string'))
/**
* Add's _1 to a string or increment the ending number to allow _2, _3, etc
*
- * @param string $str required
- * @param string $separator What should the duplicate number be appended with
- * @param string $first Which number should be used for the first dupe increment
- * @return string
+ * @param string required
+ * @param string What should the duplicate number be appended with
+ * @param string Which number should be used for the first dupe increment
+ * @return string
*/
-function increment_string($str, $separator = '_', $first = 1)
+if ( ! function_exists('increment_string'))
{
- preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match);
+ function increment_string($str, $separator = '_', $first = 1)
+ {
+ preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match);
- return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first;
+ return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first;
+ }
}
// ------------------------------------------------------------------------
@@ -271,9 +265,8 @@ function increment_string($str, $separator = '_', $first = 1)
/**
* Alternator
*
- * Allows strings to be alternated. See docs...
+ * Allows strings to be alternated. See docs...
*
- * @access public
* @param string (as many parameters as needed)
* @return string
*/
@@ -298,19 +291,17 @@ if ( ! function_exists('alternator'))
/**
* Repeater function
*
- * @access public
* @param string
- * @param integer number of repeats
+ * @param int number of repeats
* @return string
*/
if ( ! function_exists('repeater'))
{
function repeater($data, $num = 1)
{
- return (($num > 0) ? str_repeat($data, $num) : '');
+ return ($num > 0) ? str_repeat($data, $num) : '';
}
}
-
/* End of file string_helper.php */
/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file
diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php
index 9b19c7c2d..7a3db5d6b 100644
--- a/system/helpers/typography_helper.php
+++ b/system/helpers/typography_helper.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Typography Helpers
*
@@ -42,7 +40,6 @@
/**
* Convert newlines to HTML line breaks except within PRE tags
*
- * @access public
* @param string
* @return string
*/
@@ -61,8 +58,6 @@ if ( ! function_exists('nl2br_except_pre'))
/**
* Auto Typography Wrapper Function
*
- *
- * @access public
* @param string
* @param bool whether to allow javascript event handlers
* @param bool whether to reduce multiple instances of double newlines to two
@@ -86,7 +81,6 @@ if ( ! function_exists('auto_typography'))
*
* This function is a replacement for html_entity_decode()
*
- * @access public
* @param string
* @param string
* @return string
@@ -101,4 +95,4 @@ if ( ! function_exists('entity_decode'))
}
/* End of file typography_helper.php */
-/* Location: ./system/helpers/typography_helper.php */
+/* Location: ./system/helpers/typography_helper.php */ \ No newline at end of file