Permalink
Browse files

Style cleanup. Narf!

Signed-off-by: dchill42 <dchill42@gmail.com>
  • Loading branch information...
1 parent 68343f8 commit 8d4ff7beb61dc021011529b0a3043b1f8f59fa6b @dchill42 committed Oct 1, 2012
Showing with 158 additions and 158 deletions.
  1. +5 −5 index.php
  2. +27 −32 system/core/CodeIgniter.php
  3. +3 −9 system/core/Common.php
  4. +14 −26 system/core/Config.php
  5. +3 −1 system/core/Controller.php
  6. +3 −1 system/core/Exceptions.php
  7. +6 −4 system/core/Hooks.php
  8. +10 −8 system/core/Input.php
  9. +3 −1 system/core/Lang.php
  10. +10 −15 system/core/Loader.php
  11. +1 −1 system/core/Log.php
  12. +13 −11 system/core/Output.php
  13. +8 −13 system/core/Router.php
  14. +1 −1 system/core/Security.php
  15. +1 −1 system/core/URI.php
  16. +3 −1 system/core/Utf8.php
  17. +2 −2 system/database/DB.php
  18. +1 −1 system/database/DB_driver.php
  19. +10 −0 system/libraries/Driver.php
  20. +1 −2 system/libraries/Form_validation.php
  21. +1 −1 tests/Bootstrap.php
  22. +2 −1 tests/codeigniter/core/CodeIgniter_test.php
  23. +2 −1 tests/codeigniter/core/Controller_test.php
  24. +1 −1 tests/codeigniter/core/Lang_test.php
  25. +1 −1 tests/codeigniter/core/Loader_test.php
  26. +2 −1 tests/codeigniter/core/Log_test.php
  27. +2 −1 tests/codeigniter/core/Output_test.php
  28. +2 −1 tests/codeigniter/core/Router_test.php
  29. +1 −1 tests/codeigniter/core/URI_test.php
  30. +1 −1 tests/codeigniter/helpers/date_helper_test.php
  31. +2 −1 tests/codeigniter/libraries/Session_test.php
  32. +1 −1 tests/codeigniter/libraries/Upload_test.php
  33. +1 −1 tests/mocks/autoloader.php
  34. +1 −1 tests/mocks/ci_testcase.php
  35. +2 −1 tests/mocks/ci_testconfig.php
  36. +2 −1 tests/mocks/core/codeigniter.php
  37. +1 −1 tests/mocks/core/common.php
  38. +1 −1 tests/mocks/core/loader.php
  39. +2 −1 tests/mocks/core/log.php
  40. +2 −1 tests/mocks/core/output.php
  41. +1 −1 tests/mocks/core/router.php
  42. +1 −1 tests/mocks/core/uri.php
  43. +1 −1 tests/mocks/database/schema/skeleton.php
View
@@ -190,19 +190,19 @@
{
foreach (explode(PATH_SEPARATOR, get_include_path()) as $path)
{
- $path = rtrim($path.'\/').'/'.$system_path;
- if (is_dir($path)) {
+ $path = rtrim($path, '\/').'/'.$system_path;
+ if (is_dir($path))
+ {
$system_path = $path;
$found = TRUE;
break;
}
}
- if (!$found)
+ if ( ! $found)
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- exit('Your system folder path does not appear to be set correctly. Please open the following file '.
- 'and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME));
+ exit('Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME));
}
}
@@ -27,8 +27,6 @@
/**
* CodeIgniter Version
- *
- * @var string
*/
define('CI_VERSION', '3.0-dev');
@@ -45,56 +43,53 @@
* @link http://codeigniter.com/user_guide/
*/
class CodeIgniter {
+
/**
* Base paths for loading core classes
*
- * @access protected
- * @var array
+ * @var array
*/
public $base_paths = array();
/**
* App paths for loading core class extensions
*
- * @var array
+ * @var array
*/
public $app_paths = array();
/**
* Log threshold
*
- * @var int
+ * @var int
*/
public $log_threshold = 1;
/**
* Subclass prefix for core class extensions
*
- * @var string
+ * @var string
*/
public $subclass_prefix = '';
/**
* Is running flag to prevent run() reentry
*
- * @access protected
- * @var bool
+ * @var bool
*/
protected $_is_running = FALSE;
/**
* Display cache flag
*
- * @access protected
- * @var bool
+ * @var bool
*/
protected $_display_cache = FALSE;
/**
* CodeIgniter singleton instance
*
- * @access protected
- * @var object
+ * @staticvar object
*/
protected static $instance = NULL;
@@ -108,7 +103,7 @@ class CodeIgniter {
* @param array Autoload config
* @param string Base path
* @param string Application path
- * @access protected
+ * @return void
*/
protected function __construct($config, $autoload, $basepath, $apppath)
{
@@ -145,7 +140,7 @@ protected function __construct($config, $autoload, $basepath, $apppath)
// Check autoload for package paths to add
if (isset($autoload['packages']))
{
- foreach ((array)$autoload['packages'] as $path)
+ foreach ((array) $autoload['packages'] as $path)
{
// Resolve path and add to paths
$path = self::resolve_path($path);
@@ -170,6 +165,8 @@ protected function __construct($config, $autoload, $basepath, $apppath)
/**
* Destructor
+ *
+ * @return void
*/
public function __destruct()
{
@@ -188,6 +185,7 @@ public function __destruct()
* All other loadables are loaded via CI_Loader.
* The second parameter supports overriding the APPPATH constant in unit testing.
*
+ * @static
* @param string Optional base path override (for unit tests)
* @param string Optional app path override (for unit tests)
* @param string Optional environment override (for unit tests)
@@ -226,7 +224,7 @@ public static function &instance($basepath = NULL, $apppath = NULL, $env = NULL)
{
include($path.$name.'.php');
}
- else if ($name == 'config')
+ elseif ($name === 'config')
{
// Can't run without main config - error out
static::_status_exit(503, 'The configuration file does not exist.');
@@ -250,16 +248,16 @@ public static function &instance($basepath = NULL, $apppath = NULL, $env = NULL)
{
$autoload = array();
}
- else if (isset($autoload['packages']))
+ elseif (isset($autoload['packages']))
{
- foreach ((array)$autoload['packages'] as $path)
+ foreach ((array) $autoload['packages'] as $path)
{
array_unshift($packages, self::resolve_path($path));
}
}
// Are any values being dynamically replaced?
- if ( ! empty($assign_to_config) > 0)
+ if ( ! empty($assign_to_config))
{
$config = array_merge($config, $assign_to_config);
}
@@ -473,7 +471,7 @@ public function log_message($level = 'error', $message, $php_error = FALSE)
*
* @param mixed class name or object
* @param string method
- * @return boolean TRUE if publicly callable, otherwise FALSE
+ * @return bool TRUE if publicly callable, otherwise FALSE
*/
public function is_callable($class, $method)
{
@@ -512,7 +510,7 @@ public function call_controller($class, $method, array $args = array(), $name =
// Call _remap
$result = $this->$name->_remap($method, $args);
}
- else if ($this->is_callable($class, $method))
+ elseif ($this->is_callable($class, $method))
{
// Call method
$result = call_user_func_array(array(&$this->$name, $method), $args);
@@ -538,7 +536,7 @@ public function call_controller($class, $method, array $args = array(), $name =
}
// Return success status or result
- return $status ? TRUE : $result;
+ return ($status) ? TRUE : $result;
}
/**
@@ -586,7 +584,6 @@ public function run()
* that lay the foundation for the rest of the core
* Benchmark, Config, Hooks, and Loader
*
- * @access protected
* @return void
*/
protected function _load_base()
@@ -615,7 +612,6 @@ protected function _load_base()
* UTF-8, URI, Output, and Routing
* If a cache is found, we output it and exit at the end of the call.
*
- * @access protected
* @return void
*/
protected function _load_routing()
@@ -681,7 +677,6 @@ protected function _load_support()
/**
* Load and run routed Controller
*
- * @access protected
* @return void
*/
protected function _run_controller()
@@ -724,7 +719,6 @@ protected function _run_controller()
* This gets run from the destructor, so we check the existence of everything
* we need as opposed to assuming it's loaded.
*
- * @access protected
* @return void
*/
protected function _finalize()
@@ -814,15 +808,16 @@ public function _exception_handler($severity, $message, $filepath, $line)
$this->exceptions->log_exception($severity, $message, $filepath, $line);
}
+
}
-/**
- * Global function to get CodeIgniter instance
- *
- * @return object CodeIgniter instance
- */
if ( ! function_exists('get_instance'))
{
+ /**
+ * Global function to get CodeIgniter instance
+ *
+ * @return object CodeIgniter instance
+ */
function &get_instance()
{
return CodeIgniter::instance();
@@ -838,4 +833,4 @@ function &get_instance()
/* End of file CodeIgniter.php */
-/* Location: ./system/core/CodeIgniter.php */
+/* Location: ./system/core/CodeIgniter.php */
@@ -219,15 +219,9 @@ function &get_config($replace = array())
*/
function config_item($item)
{
- // Get instance and check for config
+ // Get instance and return config item or FALSE
$CI = CodeIgniter::instance();
- if ( ! isset($CI->config))
- {
- return FALSE;
- }
-
- // Return config item
- return $CI->config->item($item);
+ return isset($CI->config) ? $CI->config->item($item) : FALSE;
}
}
@@ -510,4 +504,4 @@ function _stringify_attributes($attributes, $js = FALSE)
}
/* End of file Common.php */
-/* Location: ./system/core/Common.php */
+/* Location: ./system/core/Common.php */
@@ -37,32 +37,33 @@
* @link http://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Config {
+
/**
* List of all loaded config values
*
- * @var array
+ * @var array
*/
public $config = array();
/**
* List of all loaded config files
*
- * @var array
+ * @var array
*/
public $is_loaded = array();
/**
* List of paths to search when trying to load a config file.
* This must be public as it's used by the Loader class.
*
- * @var array
+ * @var array
*/
public $_config_paths = array();
/**
* Callback to array merging function
*
- * @var callback
+ * @var callback
*/
protected $merge_arrays;
@@ -93,7 +94,7 @@ public function __construct()
$autoload = $CI->_autoload;
if (is_array($autoload) && isset($autoload['config']))
{
- foreach ((array)$autoload['config'] as $file)
+ foreach ((array) $autoload['config'] as $file)
{
$this->load($file);
}
@@ -150,7 +151,7 @@ public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE
}
show_error('The configuration file '.$file.'.php does not exist.');
}
- else if (is_string($config))
+ elseif (is_string($config))
{
if ($fail_gracefully)
{
@@ -163,14 +164,7 @@ public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE
if ($use_sections === TRUE)
{
// Merge or set section
- if (isset($this->config[$file]))
- {
- $this->config[$file] = array_merge($this->config[$file], $config);
- }
- else
- {
- $this->config[$file] = $config;
- }
+ $this->config[$file] = isset($this->config[$file]) ? array_merge($this->config[$file], $config) : $config;
}
else
{
@@ -219,7 +213,7 @@ public function get($file, $name = NULL)
public function get_ext($_file, $_name, &$_extras)
{
// Ensure file ends with .php
- if (!preg_match('/\.php$/', $_file))
+ if ( ! preg_match('/\.php$/', $_file))
{
$_file .= '.php';
}
@@ -258,7 +252,7 @@ public function get_ext($_file, $_name, &$_extras)
// Use the return value of the file we captured above
$_name = '_return';
}
- else if (empty($_name))
+ elseif (empty($_name))
{
// Nope - just note we found something
$_merged = TRUE;
@@ -279,15 +273,8 @@ public function get_ext($_file, $_name, &$_extras)
}
}
- // Test for merged config
- if (empty($_merged))
- {
- // None - quit
- return FALSE;
- }
-
- // Return merged config
- return $_merged;
+ // Return merged config or FALSE
+ return empty($_merged) ? FALSE : $_merged;
}
// --------------------------------------------------------------------
@@ -467,7 +454,8 @@ protected function _merge_arrays(array $main, array &$new)
// Return merged array
return $main;
}
+
}
/* End of file Config.php */
-/* Location: ./system/core/Config.php */
+/* Location: ./system/core/Config.php */
Oops, something went wrong.

0 comments on commit 8d4ff7b

Please sign in to comment.