Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Docblock improvements

  • Loading branch information...
commit 3e9d2b8ae82948de3c83bd5a50151949f6e6ca90 1 parent 7d75346
Andrey Andreev narfbg authored
32 system/core/Benchmark.php
@@ -26,7 +26,7 @@
26 26 */
27 27
28 28 /**
29   - * CodeIgniter Benchmark Class
  29 + * Benchmark Class
30 30 *
31 31 * This class enables you to mark points and calculate the time difference
32 32 * between them. Memory consumption can also be displayed.
@@ -40,21 +40,19 @@
40 40 class CI_Benchmark {
41 41
42 42 /**
43   - * List of all benchmark markers and when they were added
  43 + * List of all benchmark markers
44 44 *
45   - * @var array
  45 + * @var array
46 46 */
47   - public $marker = array();
48   -
49   - // --------------------------------------------------------------------
  47 + public $marker = array();
50 48
51 49 /**
52 50 * Set a benchmark marker
53 51 *
54 52 * Multiple calls to this function can be made so that several
55   - * execution points can be timed
  53 + * execution points can be timed.
56 54 *
57   - * @param string $name name of the marker
  55 + * @param string $name Marker name
58 56 * @return void
59 57 */
60 58 public function mark($name)
@@ -65,6 +63,8 @@ public function mark($name)
65 63 // --------------------------------------------------------------------
66 64
67 65 /**
  66 + * Elapsed time
  67 + *
68 68 * Calculates the time difference between two marked points.
69 69 *
70 70 * If the first parameter is empty this function instead returns the
@@ -72,10 +72,13 @@ public function mark($name)
72 72 * execution time to be shown in a template. The output class will
73 73 * swap the real value for this variable.
74 74 *
75   - * @param string a particular marked point
76   - * @param string a particular marked point
77   - * @param integer the number of decimal places
78   - * @return mixed
  75 + * @param string $point1 A particular marked point
  76 + * @param string $point2 A particular marked point
  77 + * @param int $decimals Number of decimal places
  78 + *
  79 + * @return string Calculated elapsed time on success,
  80 + * an '{elapsed_string}' if $point1 is empty
  81 + * or an empty string if $point1 is not found.
79 82 */
80 83 public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
81 84 {
@@ -102,12 +105,13 @@ public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
102 105 /**
103 106 * Memory Usage
104 107 *
105   - * This function returns the {memory_usage} pseudo-variable.
  108 + * Simply returns the {memory_usage} marker.
  109 + *
106 110 * This permits it to be put it anywhere in a template
107 111 * without the memory being calculated until the end.
108 112 * The output class will swap the real value for this variable.
109 113 *
110   - * @return string
  114 + * @return string '{memory_usage}'
111 115 */
112 116 public function memory_usage()
113 117 {
11 system/core/Controller.php
@@ -26,7 +26,7 @@
26 26 */
27 27
28 28 /**
29   - * CodeIgniter Application Controller Class
  29 + * Application Controller Class
30 30 *
31 31 * This class object is the super class that every library in
32 32 * CodeIgniter will be assigned to.
@@ -40,15 +40,14 @@
40 40 class CI_Controller {
41 41
42 42 /**
43   - * Reference to the global CI instance
  43 + * Reference to the CI singleton
44 44 *
45   - * @static
46 45 * @var object
47 46 */
48 47 private static $instance;
49 48
50 49 /**
51   - * Set up controller properties and methods
  50 + * Class constructor
52 51 *
53 52 * @return void
54 53 */
@@ -69,8 +68,10 @@ public function __construct()
69 68 log_message('debug', 'Controller Class Initialized');
70 69 }
71 70
  71 + // --------------------------------------------------------------------
  72 +
72 73 /**
73   - * Return the CI object
  74 + * Get the CI singleton
74 75 *
75 76 * @static
76 77 * @return object
48 system/core/Exceptions.php
@@ -64,7 +64,7 @@ class CI_Exceptions {
64 64 );
65 65
66 66 /**
67   - * Initialize execption class
  67 + * Class constructor
68 68 *
69 69 * @return void
70 70 */
@@ -79,12 +79,12 @@ public function __construct()
79 79 /**
80 80 * Exception Logger
81 81 *
82   - * This function logs PHP generated error messages
  82 + * Logs PHP generated error messages
83 83 *
84   - * @param string the error severity
85   - * @param string the error string
86   - * @param string the error filepath
87   - * @param string the error line number
  84 + * @param int $severity Log level
  85 + * @param string $message Error message
  86 + * @param string $filepath File path
  87 + * @param int $line Line number
88 88 * @return void
89 89 */
90 90 public function log_exception($severity, $message, $filepath, $line)
@@ -96,11 +96,13 @@ public function log_exception($severity, $message, $filepath, $line)
96 96 // --------------------------------------------------------------------
97 97
98 98 /**
99   - * 404 Page Not Found Handler
  99 + * 404 Error Handler
100 100 *
101   - * @param string the page
102   - * @param bool log error yes/no
103   - * @return string
  101 + * @uses CI_Exceptions::show_error()
  102 + *
  103 + * @param string $page Page URI
  104 + * @param bool $log_error Whether to log the error
  105 + * @return void
104 106 */
105 107 public function show_404($page = '', $log_error = TRUE)
106 108 {
@@ -122,15 +124,15 @@ public function show_404($page = '', $log_error = TRUE)
122 124 /**
123 125 * General Error Page
124 126 *
125   - * This function takes an error message as input
126   - * (either as a string or an array) and displays
127   - * it using the specified template.
  127 + * Takes an error message as input (either as a string or an array)
  128 + * and displays it using the specified template.
  129 + *
  130 + * @param string $heading Page heading
  131 + * @param string|string[] $message Error message
  132 + * @param string $template Template name
  133 + * @param int $statis_code (default: 500)
128 134 *
129   - * @param string the heading
130   - * @param string the message
131   - * @param string the template name
132   - * @param int the status code
133   - * @return string
  135 + * @return string Error page output
134 136 */
135 137 public function show_error($heading, $message, $template = 'error_general', $status_code = 500)
136 138 {
@@ -154,11 +156,11 @@ public function show_error($heading, $message, $template = 'error_general', $sta
154 156 /**
155 157 * Native PHP error handler
156 158 *
157   - * @param string the error severity
158   - * @param string the error string
159   - * @param string the error filepath
160   - * @param string the error line number
161   - * @return string
  159 + * @param int $severity Error level
  160 + * @param string $message Error message
  161 + * @param string $filepath File path
  162 + * @param int $line Line number
  163 + * @return string Error page output
162 164 */
163 165 public function show_php_error($severity, $message, $filepath, $line)
164 166 {
68 system/core/Hooks.php
@@ -26,7 +26,7 @@
26 26 */
27 27
28 28 /**
29   - * CodeIgniter Hooks Class
  29 + * Hooks Class
30 30 *
31 31 * Provides a mechanism to extend the base system without hacking.
32 32 *
@@ -41,26 +41,28 @@ class CI_Hooks {
41 41 /**
42 42 * Determines whether hooks are enabled
43 43 *
44   - * @var bool
  44 + * @var bool
45 45 */
46   - public $enabled = FALSE;
  46 + public $enabled = FALSE;
47 47
48 48 /**
49 49 * List of all hooks set in config/hooks.php
50 50 *
51   - * @var array
  51 + * @var array
52 52 */
53 53 public $hooks = array();
54 54
55 55 /**
  56 + * In progress flag
  57 + *
56 58 * Determines whether hook is in progress, used to prevent infinte loops
57 59 *
58   - * @var bool
  60 + * @var bool
59 61 */
60   - public $in_progress = FALSE;
  62 + protected $_in_progress = FALSE;
61 63
62 64 /**
63   - * Initialize the Hooks Preferences
  65 + * Class constructor
64 66 *
65 67 * @return void
66 68 */
@@ -104,8 +106,10 @@ public function __construct()
104 106 *
105 107 * Calls a particular hook. Called by CodeIgniter.php.
106 108 *
107   - * @param string the hook name
108   - * @return mixed
  109 + * @uses CI_Hooks::_run_hook()
  110 + *
  111 + * @param string $which Hook name
  112 + * @return bool TRUE on success or FALSE on failure
109 113 */
110 114 public function call_hook($which = '')
111 115 {
@@ -136,8 +140,8 @@ public function call_hook($which = '')
136 140 *
137 141 * Runs a particular hook
138 142 *
139   - * @param array the hook details
140   - * @return bool
  143 + * @param array $data Hook details
  144 + * @return bool TRUE on success or FALSE on failure
141 145 */
142 146 protected function _run_hook($data)
143 147 {
@@ -152,7 +156,7 @@ protected function _run_hook($data)
152 156
153 157 // If the script being called happens to have the same
154 158 // hook call within it a loop can happen
155   - if ($this->in_progress === TRUE)
  159 + if ($this->_in_progress === TRUE)
156 160 {
157 161 return;
158 162 }
@@ -173,44 +177,20 @@ protected function _run_hook($data)
173 177 return FALSE;
174 178 }
175 179
176   - // -----------------------------------
177   - // Set class/function name
178   - // -----------------------------------
179   -
180   - $class = FALSE;
181   - $function = FALSE;
182   - $params = '';
183   -
184   - if ( ! empty($data['class']))
185   - {
186   - $class = $data['class'];
187   - }
188   -
189   - if ( ! empty($data['function']))
190   - {
191   - $function = $data['function'];
192   - }
193   -
194   - if (isset($data['params']))
195   - {
196   - $params = $data['params'];
197   - }
  180 + // Determine and class and/or function names
  181 + $class = empty($data['class']) ? FALSE : $data['class'];
  182 + $function = empty($data['function']) ? FALSE : $data['function'];
  183 + $params = isset($data['params']) ? $data['params'] : '';
198 184
199 185 if ($class === FALSE && $function === FALSE)
200 186 {
201 187 return FALSE;
202 188 }
203 189
204   - // -----------------------------------
205   - // Set the in_progress flag
206   - // -----------------------------------
207   -
208   - $this->in_progress = TRUE;
  190 + // Set the _in_progress flag
  191 + $this->_in_progress = TRUE;
209 192
210   - // -----------------------------------
211 193 // Call the requested class and/or function
212   - // -----------------------------------
213   -
214 194 if ($class !== FALSE)
215 195 {
216 196 if ( ! class_exists($class))
@@ -218,7 +198,7 @@ protected function _run_hook($data)
218 198 require($filepath);
219 199 }
220 200
221   - $HOOK = new $class;
  201 + $HOOK = new $class();
222 202 $HOOK->$function($params);
223 203 }
224 204 else
@@ -231,7 +211,7 @@ protected function _run_hook($data)
231 211 $function($params);
232 212 }
233 213
234   - $this->in_progress = FALSE;
  214 + $this->_in_progress = FALSE;
235 215 return TRUE;
236 216 }
237 217
27 system/core/Lang.php
@@ -39,19 +39,19 @@ class CI_Lang {
39 39 /**
40 40 * List of translations
41 41 *
42   - * @var array
  42 + * @var array
43 43 */
44 44 public $language = array();
45 45
46 46 /**
47 47 * List of loaded language files
48 48 *
49   - * @var array
  49 + * @var array
50 50 */
51 51 public $is_loaded = array();
52 52
53 53 /**
54   - * Initialize language class
  54 + * Class constructor
55 55 *
56 56 * @return void
57 57 */
@@ -65,12 +65,13 @@ public function __construct()
65 65 /**
66 66 * Load a language file
67 67 *
68   - * @param mixed $langile the name of the language file to be loaded
69   - * @param string $idiom = '' the language (english, etc.)
70   - * @param bool $return = FALSE return loaded array of translations
71   - * @param bool $add_suffix = TRUE add suffix to $langfile
72   - * @param string $alt_path = '' alternative path to look for language file
73   - * @return mixed
  68 + * @param mixed $langfile Language file name
  69 + * @param string $idiom Language name (english, etc.)
  70 + * @param bool $return Whether to return the loaded array of translations
  71 + * @param bool $add_suffix Whether to add suffix to $langfile
  72 + * @param string $alt_path Alternative path to look for the language file
  73 + *
  74 + * @return void|string[] Array containing translations, if $return is set to TRUE
74 75 */
75 76 public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
76 77 {
@@ -146,10 +147,12 @@ public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE
146 147 // --------------------------------------------------------------------
147 148
148 149 /**
149   - * Fetch a single line of text from the language array
  150 + * Language line
  151 + *
  152 + * Fetches a single line of text from the language array
150 153 *
151   - * @param string $line the language line
152   - * @return string
  154 + * @param string $line Language line key
  155 + * @return string Translation
153 156 */
154 157 public function line($line = '')
155 158 {
10 system/core/Model.php
@@ -26,7 +26,7 @@
26 26 */
27 27
28 28 /**
29   - * CodeIgniter Model Class
  29 + * Model Class
30 30 *
31 31 * @package CodeIgniter
32 32 * @subpackage Libraries
@@ -37,7 +37,7 @@
37 37 class CI_Model {
38 38
39 39 /**
40   - * Initialize CI_Model Class
  40 + * Class constructor
41 41 *
42 42 * @return void
43 43 */
@@ -46,13 +46,15 @@ public function __construct()
46 46 log_message('debug', 'Model Class Initialized');
47 47 }
48 48
  49 + // --------------------------------------------------------------------
  50 +
49 51 /**
50   - * __get
  52 + * __get magic
51 53 *
52 54 * Allows models to access CI's loaded classes using the same
53 55 * syntax as controllers.
54 56 *
55   - * @param string
  57 + * @param string $key
56 58 */
57 59 public function __get($key)
58 60 {
26 system/core/Utf8.php
@@ -39,9 +39,9 @@
39 39 class CI_Utf8 {
40 40
41 41 /**
42   - * Constructor
  42 + * Class constructor
43 43 *
44   - * Determines if UTF-8 support is to be enabled
  44 + * Determines if UTF-8 support is to be enabled.
45 45 *
46 46 * @return void
47 47 */
@@ -87,9 +87,11 @@ public function __construct()
87 87 /**
88 88 * Clean UTF-8 strings
89 89 *
90   - * Ensures strings are UTF-8
  90 + * Ensures strings contain only valid UTF-8 characters.
91 91 *
92   - * @param string
  92 + * @uses CI_Utf8::_is_ascii() Decide whether a conversion is needed
  93 + *
  94 + * @param string $str String to clean
93 95 * @return string
94 96 */
95 97 public function clean_string($str)
@@ -109,9 +111,9 @@ public function clean_string($str)
109 111 *
110 112 * Removes all ASCII control characters except horizontal tabs,
111 113 * line feeds, and carriage returns, as all others can cause
112   - * problems in XML
  114 + * problems in XML.
113 115 *
114   - * @param string
  116 + * @param string $str String to clean
115 117 * @return string
116 118 */
117 119 public function safe_ascii_for_xml($str)
@@ -124,11 +126,11 @@ public function safe_ascii_for_xml($str)
124 126 /**
125 127 * Convert to UTF-8
126 128 *
127   - * Attempts to convert a string to UTF-8
  129 + * Attempts to convert a string to UTF-8.
128 130 *
129   - * @param string
130   - * @param string input encoding
131   - * @return string
  131 + * @param string $str Input string
  132 + * @param string $encoding Input encoding
  133 + * @return string $str encoded in UTF-8 or FALSE on failure
132 134 */
133 135 public function convert_to_utf8($str, $encoding)
134 136 {
@@ -149,9 +151,9 @@ public function convert_to_utf8($str, $encoding)
149 151 /**
150 152 * Is ASCII?
151 153 *
152   - * Tests if a string is standard 7-bit ASCII or not
  154 + * Tests if a string is standard 7-bit ASCII or not.
153 155 *
154   - * @param string
  156 + * @param string $str String to check
155 157 * @return bool
156 158 */
157 159 protected function _is_ascii($str)
4 system/database/drivers/odbc/odbc_driver.php
@@ -50,7 +50,9 @@ class CI_DB_odbc_driver extends CI_DB {
50 50 protected $_random_keyword;
51 51
52 52 /**
53   - * @var string Database schema
  53 + * Database schema
  54 + *
  55 + * @var string
54 56 */
55 57 public $schema = 'public';
56 58
4 system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
@@ -51,7 +51,9 @@ class CI_DB_pdo_odbc_driver extends CI_DB_pdo_driver {
51 51 protected $_random_keyword = ' RAND()';
52 52
53 53 /**
54   - * @var string Database schema
  54 + * Database schema
  55 + *
  56 + * @var string
55 57 */
56 58 public $schema = 'public';
57 59
4 system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
@@ -45,7 +45,9 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver {
45 45 protected $_random_keyword = ' RANDOM()';
46 46
47 47 /**
48   - * @var string Database schema
  48 + * Database schema
  49 + *
  50 + * @var string
49 51 */
50 52 public $schema = 'public';
51 53
4 system/database/drivers/postgre/postgre_driver.php
@@ -47,7 +47,9 @@ class CI_DB_postgre_driver extends CI_DB {
47 47 protected $_random_keyword = ' RANDOM()'; // database specific random keyword
48 48
49 49 /**
50   - * @var string Database schema
  50 + * Database schema
  51 + *
  52 + * @var string
51 53 */
52 54 public $schema = 'public';
53 55
8 system/libraries/Calendar.php
@@ -95,11 +95,13 @@ class CI_Calendar {
95 95 public $next_prev_url = '';
96 96
97 97 /**
98   - * Constructor
  98 + * Class constructor
99 99 *
100   - * Loads the calendar language file and sets the default time reference
  100 + * Loads the calendar language file and sets the default time reference.
101 101 *
102   - * @param array
  102 + * @uses CI_Lang::$is_loaded
  103 + *
  104 + * @param array $config Calendar options
103 105 * @return void
104 106 */
105 107 public function __construct($config = array())

0 comments on commit 3e9d2b8

Please sign in to comment.
Something went wrong with that request. Please try again.