summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/helpers/date_helper.php67
-rw-r--r--system/helpers/directory_helper.php2
-rw-r--r--system/helpers/inflector_helper.php20
-rw-r--r--system/helpers/security_helper.php2
-rw-r--r--system/helpers/smiley_helper.php7
-rw-r--r--system/helpers/text_helper.php29
6 files changed, 48 insertions, 79 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 66f21c1f5..f1ba364f5 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Date Helpers
*
@@ -44,8 +42,7 @@
*
* Returns time() or its GMT equivalent based on the config file preference
*
- * @access public
- * @return integer
+ * @return int
*/
if ( ! function_exists('now'))
{
@@ -85,10 +82,9 @@ if ( ! function_exists('now'))
* have to worry about escaping your text letters that
* match the date codes.
*
- * @access public
* @param string
- * @param integer
- * @return integer
+ * @param int
+ * @return int
*/
if ( ! function_exists('mdate'))
{
@@ -118,9 +114,8 @@ if ( ! function_exists('mdate'))
*
* Returns a date formatted according to the submitted standard.
*
- * @access public
* @param string the chosen format
- * @param integer Unix timestamp
+ * @param int Unix timestamp
* @return string
*/
if ( ! function_exists('standard_date'))
@@ -157,10 +152,9 @@ if ( ! function_exists('standard_date'))
* Returns a span of seconds in this format:
* 10 days 14 hours 36 minutes 47 seconds
*
- * @access public
- * @param integer a number of seconds
- * @param integer Unix timestamp
- * @param integer a number of display units
+ * @param int a number of seconds
+ * @param int Unix timestamp
+ * @param int a number of display units
* @return string
*/
if ( ! function_exists('timespan'))
@@ -273,10 +267,9 @@ if ( ! function_exists('timespan'))
* Takes a month/year as input and returns the number of days
* for the given month/year. Takes leap years into consideration.
*
- * @access public
- * @param integer a numeric month
- * @param integer a numeric year
- * @return integer
+ * @param int a numeric month
+ * @param int a numeric year
+ * @return int
*/
if ( ! function_exists('days_in_month'))
{
@@ -294,7 +287,7 @@ if ( ! function_exists('days_in_month'))
if ($month == 2)
{
- if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0))
+ if ($year % 400 == 0 OR ($year % 4 == 0 && $year % 100 != 0))
{
return 29;
}
@@ -310,9 +303,8 @@ if ( ! function_exists('days_in_month'))
/**
* Converts a local Unix timestamp to GMT
*
- * @access public
- * @param integer Unix timestamp
- * @return integer
+ * @param int Unix timestamp
+ * @return int
*/
if ( ! function_exists('local_to_gmt'))
{
@@ -343,11 +335,10 @@ if ( ! function_exists('local_to_gmt'))
* at the local value based on the timezone and DST setting
* submitted
*
- * @access public
- * @param integer Unix timestamp
+ * @param int Unix timestamp
* @param string timezone
* @param bool whether DST is active
- * @return integer
+ * @return int
*/
if ( ! function_exists('gmt_to_local'))
{
@@ -374,9 +365,8 @@ if ( ! function_exists('gmt_to_local'))
/**
* Converts a MySQL Timestamp to Unix
*
- * @access public
- * @param integer Unix timestamp
- * @return integer
+ * @param int Unix timestamp
+ * @return int
*/
if ( ! function_exists('mysql_to_unix'))
{
@@ -409,8 +399,7 @@ if ( ! function_exists('mysql_to_unix'))
*
* Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM
*
- * @access public
- * @param integer Unix timestamp
+ * @param int Unix timestamp
* @param bool whether to show seconds
* @param string format: us or euro
* @return string
@@ -451,9 +440,8 @@ if ( ! function_exists('unix_to_human'))
*
* Reverses the above process
*
- * @access public
* @param string format: us or euro
- * @return integer
+ * @return int
*/
if ( ! function_exists('human_to_unix'))
{
@@ -499,12 +487,12 @@ if ( ! function_exists('human_to_unix'))
{
$ampm = strtolower($split['2']);
- if (substr($ampm, 0, 1) == 'p' AND $hour < 12)
+ if (substr($ampm, 0, 1) === 'p' && $hour < 12)
{
$hour = $hour + 12;
}
- if (substr($ampm, 0, 1) == 'a' AND $hour == 12)
+ if (substr($ampm, 0, 1) === 'a' && $hour == 12)
{
$hour = '00';
}
@@ -525,10 +513,9 @@ if ( ! function_exists('human_to_unix'))
* Turns many "reasonably-date-like" strings into something
* that is actually useful. This only works for dates after unix epoch.
*
- * @access public
- * @param string The terribly formatted date-like string
- * @param string Date format to return (same as php date function)
- * @return string
+ * @param string The terribly formatted date-like string
+ * @param string Date format to return (same as php date function)
+ * @return string
*/
if ( ! function_exists('nice_date'))
{
@@ -593,7 +580,6 @@ if ( ! function_exists('nice_date'))
*
* Generates a drop-down menu of timezones.
*
- * @access public
* @param string timezone
* @param string classname
* @param string menu name
@@ -634,10 +620,9 @@ if ( ! function_exists('timezone_menu'))
/**
* Timezones
*
- * Returns an array of timezones. This is a helper function
+ * Returns an array of timezones. This is a helper function
* for various other ones in this library
*
- * @access public
* @param string timezone
* @return string
*/
@@ -698,7 +683,7 @@ if ( ! function_exists('timezones'))
$tz = ($tz == 'GMT') ? 'UTC' : $tz;
- return ( ! isset($zones[$tz])) ? 0 : $zones[$tz];
+ return isset($zones[$tz]) ? $zones[$tz] : 0;
}
}
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php
index d7ca13e85..4044ace11 100644
--- a/system/helpers/directory_helper.php
+++ b/system/helpers/directory_helper.php
@@ -85,4 +85,4 @@ if ( ! function_exists('directory_map'))
}
/* End of file directory_helper.php */
-/* Location: ./system/helpers/directory_helper.php */
+/* Location: ./system/helpers/directory_helper.php */ \ No newline at end of file
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php
index 485806b20..feeaf57d7 100644
--- a/system/helpers/inflector_helper.php
+++ b/system/helpers/inflector_helper.php
@@ -199,8 +199,8 @@ if ( ! function_exists('underscore'))
*
* Takes multiple words separated by the separator and changes them to spaces
*
- * @param string $str
- * @param string $separator
+ * @param string $str
+ * @param string $separator
* @return str
*/
if ( ! function_exists('humanize'))
@@ -214,19 +214,21 @@ if ( ! function_exists('humanize'))
/**
* Checks if the given word has a plural version.
*
- * @param string the word to check
- * @return bool if the word is countable
+ * @param string the word to check
+ * @return bool if the word is countable
*/
if ( ! function_exists('is_countable'))
{
function is_countable($word)
{
- return ! (in_array(strtolower(strval($word)), array(
- 'equipment', 'information', 'rice', 'money',
- 'species', 'series', 'fish', 'meta'
- )));
+ return ! in_array(strtolower(strval($word)),
+ array(
+ 'equipment', 'information', 'rice', 'money',
+ 'species', 'series', 'fish', 'meta'
+ )
+ );
}
}
/* End of file inflector_helper.php */
-/* Location: ./system/helpers/inflector_helper.php */
+/* Location: ./system/helpers/inflector_helper.php */ \ No newline at end of file
diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php
index 8c7adea46..d6f134c9f 100644
--- a/system/helpers/security_helper.php
+++ b/system/helpers/security_helper.php
@@ -124,4 +124,4 @@ if ( ! function_exists('encode_php_tags'))
}
/* End of file security_helper.php */
-/* Location: ./system/helpers/security_helper.php */
+/* Location: ./system/helpers/security_helper.php */ \ No newline at end of file
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 790a15264..8dba74e73 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Smiley Helpers
*
@@ -45,7 +43,6 @@
* Returns the javascript required for the smiley insertion. Optionally takes
* an array of aliases to loosely couple the smiley array to the view.
*
- * @access public
* @param mixed alias name or array of alias->field_id pairs
* @param string field_id if alias name was passed in
* @return array
@@ -139,7 +136,6 @@ EOF;
* Returns an array of image tag links that can be clicked to be inserted
* into a form field.
*
- * @access public
* @param string the URL to the folder containing the smiley images
* @return array
*/
@@ -193,7 +189,6 @@ if ( ! function_exists('get_clickable_smileys'))
*
* Takes a string as input and swaps any contained smileys for the actual image
*
- * @access public
* @param string the text to be parsed
* @param string the URL to the folder containing the smiley images
* @return string
@@ -234,7 +229,6 @@ if ( ! function_exists('parse_smileys'))
*
* Fetches the config/smiley.php file
*
- * @access private
* @return mixed
*/
if ( ! function_exists('_get_smiley_array'))
@@ -268,7 +262,6 @@ if ( ! function_exists('_get_smiley_array'))
*
* DEPRECATED as of version 1.7.2, use smiley_js instead
*
- * @access public
* @param string form name
* @param string field name
* @return string
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 2d0f78d2c..cc501c334 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Text Helpers
*
@@ -44,9 +42,8 @@
*
* Limits a string to X number of words.
*
- * @access public
* @param string
- * @param integer
+ * @param int
* @param string the end character. Usually an ellipsis
* @return string
*/
@@ -78,9 +75,8 @@ if ( ! function_exists('word_limiter'))
* Limits the string based on the character count. Preserves complete words
* so the character count may not be exactly as specified.
*
- * @access public
* @param string
- * @param integer
+ * @param int
* @param string the end character. Usually an ellipsis
* @return string
*/
@@ -121,7 +117,6 @@ if ( ! function_exists('character_limiter'))
*
* Converts High ascii text and MS Word special characters to character entities
*
- * @access public
* @param string
* @return string
*/
@@ -182,7 +177,6 @@ if ( ! function_exists('ascii_to_entities'))
*
* Converts character entities back to ASCII
*
- * @access public
* @param string
* @param bool
* @return string
@@ -240,7 +234,6 @@ if ( ! function_exists('entities_to_ascii'))
* matched words will be converted to #### or to the replacement
* word you've submitted.
*
- * @access public
* @param string the text string
* @param string the array of censoered words
* @param string the optional replacement value
@@ -286,7 +279,6 @@ if ( ! function_exists('word_censor'))
*
* Colorizes code strings
*
- * @access public
* @param string the text string
* @return string
*/
@@ -330,7 +322,6 @@ if ( ! function_exists('highlight_code'))
*
* Highlights a phrase within a text string
*
- * @access public
* @param string the text string
* @param string the phrase you'd like to highlight
* @param string the openging tag to precede the phrase with
@@ -360,7 +351,6 @@ if ( ! function_exists('highlight_phrase'))
/**
* Convert Accented Foreign Characters to ASCII
*
- * @access public
* @param string the text string
* @return string
*/
@@ -368,7 +358,7 @@ if ( ! function_exists('convert_accented_characters'))
{
function convert_accented_characters($str)
{
- if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php'))
+ if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php'))
{
include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php');
}
@@ -395,9 +385,8 @@ if ( ! function_exists('convert_accented_characters'))
* Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor
* will URLs.
*
- * @access public
* @param string the text string
- * @param integer the number of characters to wrap at
+ * @param int the number of characters to wrap at
* @return string
*/
if ( ! function_exists('word_wrap'))
@@ -497,11 +486,11 @@ if ( ! function_exists('word_wrap'))
*
* This function will strip tags from a string, split it at its max_length and ellipsize
*
- * @param string string to ellipsize
- * @param integer max length of string
- * @param mixed int (1|0) or float, .5, .2, etc for position to split
- * @param string ellipsis ; Default '...'
- * @return string ellipsized string
+ * @param string string to ellipsize
+ * @param int max length of string
+ * @param mixed int (1|0) or float, .5, .2, etc for position to split
+ * @param string ellipsis ; Default '...'
+ * @return string ellipsized string
*/
if ( ! function_exists('ellipsize'))
{