@@ -39,8 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $CI->db->close(); |
41 | 41 | $CI->db = null; |
42 | - } |
|
43 | - else |
|
42 | + } else |
|
44 | 43 | { |
45 | 44 | // Don't close if SQLite in-memory database |
46 | 45 | // If we close it, all tables and stored data will be gone |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | reset_config(); |
33 | 33 | |
34 | 34 | // Close db connection |
35 | - $CI =& get_instance(); |
|
35 | + $CI = & get_instance(); |
|
36 | 36 | if (isset($CI->db)) |
37 | 37 | { |
38 | 38 | if ( |
@@ -52,25 +52,25 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // Load core classes |
55 | - $BM =& load_class('Benchmark', 'core'); |
|
55 | + $BM = & load_class('Benchmark', 'core'); |
|
56 | 56 | CIPHPUnitTestSuperGlobal::set_Global('BM', $BM); |
57 | - $EXT =& load_class('Hooks', 'core'); |
|
57 | + $EXT = & load_class('Hooks', 'core'); |
|
58 | 58 | CIPHPUnitTestSuperGlobal::set_Global('EXT', $EXT); |
59 | - $CFG =& load_class('Config', 'core'); |
|
59 | + $CFG = & load_class('Config', 'core'); |
|
60 | 60 | CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG); |
61 | - $UNI =& load_class('URI', 'core'); |
|
61 | + $UNI = & load_class('URI', 'core'); |
|
62 | 62 | CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI); |
63 | 63 | // $URI =& load_class('Utf8', 'core'); |
64 | 64 | // CIPHPUnitTestSuperGlobal::set_Global('URI', $URI); |
65 | - $RTR =& load_class('Router', 'core'); |
|
65 | + $RTR = & load_class('Router', 'core'); |
|
66 | 66 | CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR); |
67 | - $OUT =& load_class('Output', 'core'); |
|
67 | + $OUT = & load_class('Output', 'core'); |
|
68 | 68 | CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT); |
69 | - $SEC =& load_class('Security', 'core'); |
|
69 | + $SEC = & load_class('Security', 'core'); |
|
70 | 70 | CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC); |
71 | - $IN =& load_class('Input', 'core'); |
|
71 | + $IN = & load_class('Input', 'core'); |
|
72 | 72 | CIPHPUnitTestSuperGlobal::set_Global('IN', $IN); |
73 | - $LANG =& load_class('Lang', 'core'); |
|
73 | + $LANG = & load_class('Lang', 'core'); |
|
74 | 74 | CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG); |
75 | 75 | |
76 | 76 | CIPHPUnitTest::loadLoader(); |
@@ -59,7 +59,7 @@ |
||
59 | 59 | { |
60 | 60 | $this->unwrap(); |
61 | 61 | |
62 | - MonkeyPatchManager::log('stream_open: ' . $path); |
|
62 | + MonkeyPatchManager::log('stream_open: '.$path); |
|
63 | 63 | |
64 | 64 | $including = (bool) ($options & self::STREAM_OPEN_FOR_INCLUDE); |
65 | 65 | if ($including && $this->shouldPreprocess($path)) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | PHPUnit_Framework_TestCase::assertEquals( |
55 | 55 | $expected_times, |
56 | 56 | $actual_times, |
57 | - $class_method . '() expected to be not invoked, but invoked ' . $actual_times . ' times.' |
|
57 | + $class_method.'() expected to be not invoked, but invoked '.$actual_times.' times.' |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | elseif ($expected_times === '+') |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | PHPUnit_Framework_TestCase::assertGreaterThanOrEqual( |
63 | 63 | 1, |
64 | 64 | $actual_times, |
65 | - $class_method . '() expected to be invoked at least one time, but invoked ' . $actual_times . ' times.' |
|
65 | + $class_method.'() expected to be invoked at least one time, but invoked '.$actual_times.' times.' |
|
66 | 66 | ); |
67 | 67 | } |
68 | 68 | else |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | PHPUnit_Framework_TestCase::assertEquals( |
71 | 71 | $expected_times, |
72 | 72 | $actual_times, |
73 | - $class_method . '() expected to be invoked ' . $expected_times . ' times, but invoked ' . $actual_times . ' times.' |
|
73 | + $class_method.'() expected to be invoked '.$expected_times.' times, but invoked '.$actual_times.' times.' |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 | } |
@@ -31,12 +31,10 @@ discard block |
||
31 | 31 | if ($invoked === false) |
32 | 32 | { |
33 | 33 | $actual_times = 0; |
34 | - } |
|
35 | - elseif ($expected_params === null) |
|
34 | + } elseif ($expected_params === null) |
|
36 | 35 | { |
37 | 36 | $actual_times = count($invocations[$class_method]); |
38 | - } |
|
39 | - else |
|
37 | + } else |
|
40 | 38 | { |
41 | 39 | $count = 0; |
42 | 40 | foreach ($invocations[$class_method] as $actual_params) |
@@ -56,16 +54,14 @@ discard block |
||
56 | 54 | $actual_times, |
57 | 55 | $class_method . '() expected to be not invoked, but invoked ' . $actual_times . ' times.' |
58 | 56 | ); |
59 | - } |
|
60 | - elseif ($expected_times === '+') |
|
57 | + } elseif ($expected_times === '+') |
|
61 | 58 | { |
62 | 59 | PHPUnit_Framework_TestCase::assertGreaterThanOrEqual( |
63 | 60 | 1, |
64 | 61 | $actual_times, |
65 | 62 | $class_method . '() expected to be invoked at least one time, but invoked ' . $actual_times . ' times.' |
66 | 63 | ); |
67 | - } |
|
68 | - else |
|
64 | + } else |
|
69 | 65 | { |
70 | 66 | PHPUnit_Framework_TestCase::assertEquals( |
71 | 67 | $expected_times, |
@@ -18,11 +18,11 @@ |
||
18 | 18 | |
19 | 19 | if ($class === null) |
20 | 20 | { |
21 | - $message = 'exit() called in ' . $method . '() function'; |
|
21 | + $message = 'exit() called in '.$method.'() function'; |
|
22 | 22 | } |
23 | 23 | else |
24 | 24 | { |
25 | - $message = 'exit() called in ' . $class . '::' . $method . '()'; |
|
25 | + $message = 'exit() called in '.$class.'::'.$method.'()'; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $exception_name = Kenjis\MonkeyPatch\MonkeyPatchManager::getExitExceptionClassname(); |
@@ -19,8 +19,7 @@ |
||
19 | 19 | if ($class === null) |
20 | 20 | { |
21 | 21 | $message = 'exit() called in ' . $method . '() function'; |
22 | - } |
|
23 | - else |
|
22 | + } else |
|
24 | 23 | { |
25 | 24 | $message = 'exit() called in ' . $class . '::' . $method . '()'; |
26 | 25 | } |
@@ -63,63 +63,63 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @var array |
65 | 65 | */ |
66 | - protected $_ci_view_paths = array(VIEWPATH => TRUE); |
|
66 | + protected $_ci_view_paths = array(VIEWPATH => TRUE); |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * List of paths to load libraries from |
70 | 70 | * |
71 | 71 | * @var array |
72 | 72 | */ |
73 | - protected $_ci_library_paths = array(APPPATH, BASEPATH); |
|
73 | + protected $_ci_library_paths = array(APPPATH, BASEPATH); |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * List of paths to load models from |
77 | 77 | * |
78 | 78 | * @var array |
79 | 79 | */ |
80 | - protected $_ci_model_paths = array(APPPATH); |
|
80 | + protected $_ci_model_paths = array(APPPATH); |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * List of paths to load helpers from |
84 | 84 | * |
85 | 85 | * @var array |
86 | 86 | */ |
87 | - protected $_ci_helper_paths = array(APPPATH, BASEPATH); |
|
87 | + protected $_ci_helper_paths = array(APPPATH, BASEPATH); |
|
88 | 88 | |
89 | 89 | /** |
90 | 90 | * List of cached variables |
91 | 91 | * |
92 | 92 | * @var array |
93 | 93 | */ |
94 | - protected $_ci_cached_vars = array(); |
|
94 | + protected $_ci_cached_vars = array(); |
|
95 | 95 | |
96 | 96 | /** |
97 | 97 | * List of loaded classes |
98 | 98 | * |
99 | 99 | * @var array |
100 | 100 | */ |
101 | - protected $_ci_classes = array(); |
|
101 | + protected $_ci_classes = array(); |
|
102 | 102 | |
103 | 103 | /** |
104 | 104 | * List of loaded models |
105 | 105 | * |
106 | 106 | * @var array |
107 | 107 | */ |
108 | - protected $_ci_models = array(); |
|
108 | + protected $_ci_models = array(); |
|
109 | 109 | |
110 | 110 | /** |
111 | 111 | * List of loaded helpers |
112 | 112 | * |
113 | 113 | * @var array |
114 | 114 | */ |
115 | - protected $_ci_helpers = array(); |
|
115 | + protected $_ci_helpers = array(); |
|
116 | 116 | |
117 | 117 | /** |
118 | 118 | * List of class name mappings |
119 | 119 | * |
120 | 120 | * @var array |
121 | 121 | */ |
122 | - protected $_ci_varmap = array( |
|
122 | + protected $_ci_varmap = array( |
|
123 | 123 | 'unit_test' => 'unit', |
124 | 124 | 'user_agent' => 'agent' |
125 | 125 | ); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function __construct() |
137 | 137 | { |
138 | 138 | $this->_ci_ob_level = ob_get_level(); |
139 | - $this->_ci_classes =& is_loaded(); |
|
139 | + $this->_ci_classes = & is_loaded(); |
|
140 | 140 | |
141 | 141 | log_message('info', 'Loader Class Initialized'); |
142 | 142 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | return $this; |
272 | 272 | } |
273 | 273 | |
274 | - $CI =& get_instance(); |
|
274 | + $CI = & get_instance(); |
|
275 | 275 | if (isset($CI->$name)) |
276 | 276 | { |
277 | 277 | throw new RuntimeException('The model name you are loading is the name of a resource that is already being used: '.$name); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | public function database($params = '', $return = FALSE, $query_builder = NULL) |
343 | 343 | { |
344 | 344 | // Grab the super object |
345 | - $CI =& get_instance(); |
|
345 | + $CI = & get_instance(); |
|
346 | 346 | |
347 | 347 | // Do we even need to load the database class? |
348 | 348 | if ($return === FALSE && $query_builder === NULL && isset($CI->db) && is_object($CI->db) && ! empty($CI->db->conn_id)) |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $CI->db = ''; |
363 | 363 | |
364 | 364 | // Load the DB class |
365 | - $CI->db =& DB($params, $query_builder); |
|
365 | + $CI->db = & DB($params, $query_builder); |
|
366 | 366 | return $this; |
367 | 367 | } |
368 | 368 | |
@@ -377,12 +377,12 @@ discard block |
||
377 | 377 | */ |
378 | 378 | public function dbutil($db = NULL, $return = FALSE) |
379 | 379 | { |
380 | - $CI =& get_instance(); |
|
380 | + $CI = & get_instance(); |
|
381 | 381 | |
382 | 382 | if ( ! is_object($db) OR ! ($db instanceof CI_DB)) |
383 | 383 | { |
384 | 384 | class_exists('CI_DB', FALSE) OR $this->database(); |
385 | - $db =& $CI->db; |
|
385 | + $db = & $CI->db; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | require_once(BASEPATH.'database/DB_utility.php'); |
@@ -409,11 +409,11 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function dbforge($db = NULL, $return = FALSE) |
411 | 411 | { |
412 | - $CI =& get_instance(); |
|
412 | + $CI = & get_instance(); |
|
413 | 413 | if ( ! is_object($db) OR ! ($db instanceof CI_DB)) |
414 | 414 | { |
415 | 415 | class_exists('CI_DB', FALSE) OR $this->database(); |
416 | - $db =& $CI->db; |
|
416 | + $db = & $CI->db; |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | require_once(BASEPATH.'database/DB_forge.php'); |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; |
747 | 747 | |
748 | 748 | // Add config file path |
749 | - $config =& $this->_ci_get_component('config'); |
|
749 | + $config = & $this->_ci_get_component('config'); |
|
750 | 750 | $config->_config_paths[] = $path; |
751 | 751 | |
752 | 752 | return $this; |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | */ |
782 | 782 | public function remove_package_path($path = '') |
783 | 783 | { |
784 | - $config =& $this->_ci_get_component('config'); |
|
784 | + $config = & $this->_ci_get_component('config'); |
|
785 | 785 | |
786 | 786 | if ($path === '') |
787 | 787 | { |
@@ -882,12 +882,12 @@ discard block |
||
882 | 882 | |
883 | 883 | // This allows anything loaded using $this->load (views, files, etc.) |
884 | 884 | // to become accessible from within the Controller and Model functions. |
885 | - $_ci_CI =& get_instance(); |
|
885 | + $_ci_CI = & get_instance(); |
|
886 | 886 | foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var) |
887 | 887 | { |
888 | 888 | if ( ! isset($this->$_ci_key)) |
889 | 889 | { |
890 | - $this->$_ci_key =& $_ci_CI->$_ci_key; |
|
890 | + $this->$_ci_key = & $_ci_CI->$_ci_key; |
|
891 | 891 | } |
892 | 892 | } |
893 | 893 | |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | // return a new instance of the object |
1027 | 1027 | if ($object_name !== NULL) |
1028 | 1028 | { |
1029 | - $CI =& get_instance(); |
|
1029 | + $CI = & get_instance(); |
|
1030 | 1030 | if ( ! isset($CI->$object_name)) |
1031 | 1031 | { |
1032 | 1032 | return $this->_ci_init_library($class, '', $params, $object_name); |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | // return a new instance of the object |
1090 | 1090 | if ($object_name !== NULL) |
1091 | 1091 | { |
1092 | - $CI =& get_instance(); |
|
1092 | + $CI = & get_instance(); |
|
1093 | 1093 | if ( ! isset($CI->$object_name)) |
1094 | 1094 | { |
1095 | 1095 | return $this->_ci_init_library($library_name, $prefix, $params, $object_name); |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | // Don't overwrite existing properties |
1235 | - $CI =& get_instance(); |
|
1235 | + $CI = & get_instance(); |
|
1236 | 1236 | if (isset($CI->$object_name)) |
1237 | 1237 | { |
1238 | 1238 | if ($CI->$object_name instanceof $class_name) |
@@ -1365,7 +1365,7 @@ discard block |
||
1365 | 1365 | */ |
1366 | 1366 | protected function &_ci_get_component($component) |
1367 | 1367 | { |
1368 | - $CI =& get_instance(); |
|
1368 | + $CI = & get_instance(); |
|
1369 | 1369 | return $CI->$component; |
1370 | 1370 | } |
1371 | 1371 |
@@ -200,16 +200,14 @@ discard block |
||
200 | 200 | if (empty($library)) |
201 | 201 | { |
202 | 202 | return $this; |
203 | - } |
|
204 | - elseif (is_array($library)) |
|
203 | + } elseif (is_array($library)) |
|
205 | 204 | { |
206 | 205 | foreach ($library as $key => $value) |
207 | 206 | { |
208 | 207 | if (is_int($key)) |
209 | 208 | { |
210 | 209 | $this->library($value, $params); |
211 | - } |
|
212 | - else |
|
210 | + } else |
|
213 | 211 | { |
214 | 212 | $this->library($key, $params, $value); |
215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
246 | 244 | if (empty($model)) |
247 | 245 | { |
248 | 246 | return $this; |
249 | - } |
|
250 | - elseif (is_array($model)) |
|
247 | + } elseif (is_array($model)) |
|
251 | 248 | { |
252 | 249 | foreach ($model as $key => $value) |
253 | 250 | { |
@@ -313,8 +310,7 @@ discard block |
||
313 | 310 | { |
314 | 311 | throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); |
315 | 312 | } |
316 | - } |
|
317 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
313 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
318 | 314 | { |
319 | 315 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
320 | 316 | } |
@@ -471,8 +467,7 @@ discard block |
||
471 | 467 | require_once($driver_path); |
472 | 468 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
473 | 469 | } |
474 | - } |
|
475 | - else |
|
470 | + } else |
|
476 | 471 | { |
477 | 472 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
478 | 473 | } |
@@ -761,16 +756,14 @@ discard block |
||
761 | 756 | if (is_int($key)) |
762 | 757 | { |
763 | 758 | $this->driver($value, $params); |
764 | - } |
|
765 | - else |
|
759 | + } else |
|
766 | 760 | { |
767 | 761 | $this->driver($key, $params, $value); |
768 | 762 | } |
769 | 763 | } |
770 | 764 | |
771 | 765 | return $this; |
772 | - } |
|
773 | - elseif (empty($library)) |
|
766 | + } elseif (empty($library)) |
|
774 | 767 | { |
775 | 768 | return FALSE; |
776 | 769 | } |
@@ -869,8 +862,7 @@ discard block |
||
869 | 862 | array_shift($this->_ci_helper_paths); |
870 | 863 | array_shift($this->_ci_view_paths); |
871 | 864 | array_pop($config->_config_paths); |
872 | - } |
|
873 | - else |
|
865 | + } else |
|
874 | 866 | { |
875 | 867 | $path = rtrim($path, '/').'/'; |
876 | 868 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -934,8 +926,7 @@ discard block |
||
934 | 926 | { |
935 | 927 | $_ci_x = explode('/', $_ci_path); |
936 | 928 | $_ci_file = end($_ci_x); |
937 | - } |
|
938 | - else |
|
929 | + } else |
|
939 | 930 | { |
940 | 931 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
941 | 932 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1002,8 +993,7 @@ discard block |
||
1002 | 993 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
1003 | 994 | { |
1004 | 995 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
1005 | - } |
|
1006 | - else |
|
996 | + } else |
|
1007 | 997 | { |
1008 | 998 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
1009 | 999 | } |
@@ -1030,8 +1020,7 @@ discard block |
||
1030 | 1020 | if (ob_get_level() > $this->_ci_ob_level + 1) |
1031 | 1021 | { |
1032 | 1022 | ob_end_flush(); |
1033 | - } |
|
1034 | - else |
|
1023 | + } else |
|
1035 | 1024 | { |
1036 | 1025 | $_ci_CI->output->append_output(ob_get_contents()); |
1037 | 1026 | @ob_end_clean(); |
@@ -1071,8 +1060,7 @@ discard block |
||
1071 | 1060 | |
1072 | 1061 | // Get the filename from the path |
1073 | 1062 | $class = substr($class, $last_slash); |
1074 | - } |
|
1075 | - else |
|
1063 | + } else |
|
1076 | 1064 | { |
1077 | 1065 | $subdir = ''; |
1078 | 1066 | } |
@@ -1210,8 +1198,7 @@ discard block |
||
1210 | 1198 | if (file_exists(APPPATH.'tests/_ci_phpunit_test/replacing/libraries/'.$file_path.$library_name.'.php')) |
1211 | 1199 | { |
1212 | 1200 | include_once(APPPATH.'tests/_ci_phpunit_test/replacing/libraries/'.$file_path.$library_name.'.php'); |
1213 | - } |
|
1214 | - else |
|
1201 | + } else |
|
1215 | 1202 | { |
1216 | 1203 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
1217 | 1204 | } |
@@ -1227,8 +1214,7 @@ discard block |
||
1227 | 1214 | { |
1228 | 1215 | $prefix = config_item('subclass_prefix'); |
1229 | 1216 | break; |
1230 | - } |
|
1231 | - else |
|
1217 | + } else |
|
1232 | 1218 | { |
1233 | 1219 | log_message('debug', $path.' exists, but does not declare '.$subclass); |
1234 | 1220 | } |
@@ -1277,8 +1263,7 @@ discard block |
||
1277 | 1263 | { |
1278 | 1264 | include($path.'config/'.strtolower($class).'.php'); |
1279 | 1265 | $found = TRUE; |
1280 | - } |
|
1281 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1266 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1282 | 1267 | { |
1283 | 1268 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
1284 | 1269 | $found = TRUE; |
@@ -1288,8 +1273,7 @@ discard block |
||
1288 | 1273 | { |
1289 | 1274 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
1290 | 1275 | $found = TRUE; |
1291 | - } |
|
1292 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1276 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1293 | 1277 | { |
1294 | 1278 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
1295 | 1279 | $found = TRUE; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @param string $library Library name |
192 | 192 | * @param array $params Optional parameters to pass to the library class constructor |
193 | 193 | * @param string $object_name An optional object name to assign to |
194 | - * @return object |
|
194 | + * @return CI_Loader |
|
195 | 195 | * |
196 | 196 | * @codeCoverageIgnore |
197 | 197 | */ |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @param string $model Model name |
238 | 238 | * @param string $name An optional object name to assign to |
239 | 239 | * @param bool $db_conn An optional database connection configuration to initialize |
240 | - * @return object |
|
240 | + * @return CI_Loader |
|
241 | 241 | * |
242 | 242 | * modified by ci-phpunit-test |
243 | 243 | */ |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | /** |
370 | 370 | * Database Loader |
371 | 371 | * |
372 | - * @param mixed $params Database configuration options |
|
372 | + * @param string|boolean $params Database configuration options |
|
373 | 373 | * @param bool $return Whether to return the database object |
374 | 374 | * @param bool $query_builder Whether to enable Query Builder |
375 | 375 | * (overrides the configuration setting) |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | * An associative array or object containing values |
536 | 536 | * to be set, or a value's name if string |
537 | 537 | * @param string $val Value to set, only used if $vars is a string |
538 | - * @return object |
|
538 | + * @return CI_Loader |
|
539 | 539 | * |
540 | 540 | * @codeCoverageIgnore |
541 | 541 | */ |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | * Helper Loader |
610 | 610 | * |
611 | 611 | * @param string|string[] $helpers Helper name(s) |
612 | - * @return object |
|
612 | + * @return CI_Loader |
|
613 | 613 | * |
614 | 614 | * @codeCoverageIgnore |
615 | 615 | */ |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | * |
689 | 689 | * @uses CI_Loader::helper() |
690 | 690 | * @param string|string[] $helpers Helper name(s) |
691 | - * @return object |
|
691 | + * @return CI_Loader |
|
692 | 692 | * |
693 | 693 | * @codeCoverageIgnore |
694 | 694 | */ |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | * |
707 | 707 | * @param string|string[] $files List of language file names to load |
708 | 708 | * @param string Language name |
709 | - * @return object |
|
709 | + * @return CI_Loader |
|
710 | 710 | * |
711 | 711 | * @codeCoverageIgnore |
712 | 712 | */ |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | * |
807 | 807 | * @param string $path Path to add |
808 | 808 | * @param bool $view_cascade (default: TRUE) |
809 | - * @return object |
|
809 | + * @return CI_Loader |
|
810 | 810 | * |
811 | 811 | * @codeCoverageIgnore |
812 | 812 | */ |
@@ -854,7 +854,7 @@ discard block |
||
854 | 854 | * added path will be removed removed. |
855 | 855 | * |
856 | 856 | * @param string $path Path to remove |
857 | - * @return object |
|
857 | + * @return CI_Loader |
|
858 | 858 | * |
859 | 859 | * @codeCoverageIgnore |
860 | 860 | */ |
@@ -105,7 +105,7 @@ |
||
105 | 105 | ob_end_clean(); |
106 | 106 | } |
107 | 107 | |
108 | - throw new CIPHPUnitTestRedirectException('Redirect to ' . $uri, $code); |
|
108 | + throw new CIPHPUnitTestRedirectException('Redirect to '.$uri, $code); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
@@ -63,16 +63,14 @@ discard block |
||
63 | 63 | if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) |
64 | 64 | { |
65 | 65 | $method = 'refresh'; |
66 | - } |
|
67 | - elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
66 | + } elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
68 | 67 | { |
69 | 68 | if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') |
70 | 69 | { |
71 | 70 | $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') |
72 | 71 | ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get |
73 | 72 | : 307; |
74 | - } |
|
75 | - else |
|
73 | + } else |
|
76 | 74 | { |
77 | 75 | $code = 302; |
78 | 76 | } |
@@ -97,8 +95,7 @@ discard block |
||
97 | 95 | if (ENVIRONMENT !== 'testing') |
98 | 96 | { |
99 | 97 | exit; |
100 | - } |
|
101 | - else |
|
98 | + } else |
|
102 | 99 | { |
103 | 100 | while (ob_get_level() > 1) |
104 | 101 | { |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function test_APPPATH() |
26 | 26 | { |
27 | 27 | $actual = realpath(APPPATH); |
28 | - $expected = realpath(__DIR__ . '/../..'); |
|
28 | + $expected = realpath(__DIR__.'/../..'); |
|
29 | 29 | $this->assertEquals( |
30 | 30 | $expected, |
31 | 31 | $actual, |
@@ -102,7 +102,7 @@ |
||
102 | 102 | elseif (strpos($class, 'CI_DB') === 0) |
103 | 103 | { |
104 | 104 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
105 | - $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
|
105 | + $file = $dir.str_replace(array('CI_DB', 'active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
|
106 | 106 | } |
107 | 107 | else |
108 | 108 | { |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | if (strpos($class, 'Mock_') === 0) |
64 | 64 | { |
65 | 65 | $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class)); |
66 | - } |
|
67 | - elseif (strpos($class, 'CI_') === 0) |
|
66 | + } elseif (strpos($class, 'CI_') === 0) |
|
68 | 67 | { |
69 | 68 | $subclass = substr($class, 3); |
70 | 69 | |
@@ -72,39 +71,32 @@ discard block |
||
72 | 71 | { |
73 | 72 | $dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR; |
74 | 73 | $class = $subclass; |
75 | - } |
|
76 | - elseif (in_array($subclass, $ci_libraries)) |
|
74 | + } elseif (in_array($subclass, $ci_libraries)) |
|
77 | 75 | { |
78 | 76 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR; |
79 | 77 | $class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass; |
80 | - } |
|
81 | - elseif (in_array($subclass, $ci_drivers)) |
|
78 | + } elseif (in_array($subclass, $ci_drivers)) |
|
82 | 79 | { |
83 | 80 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR; |
84 | 81 | $class = $subclass; |
85 | - } |
|
86 | - elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
82 | + } elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
87 | 83 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
88 | 84 | $class = $subclass; |
89 | - } |
|
90 | - elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
85 | + } elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
91 | 86 | { |
92 | 87 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
93 | 88 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR; |
94 | 89 | $file = $dir.$m[1].'_'.$m[2].'_'.$m[3].'.php'; |
95 | - } |
|
96 | - elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
90 | + } elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
97 | 91 | { |
98 | 92 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
99 | 93 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR; |
100 | 94 | $file = $dir.$m[1].'_'.$m[2].'.php'; |
101 | - } |
|
102 | - elseif (strpos($class, 'CI_DB') === 0) |
|
95 | + } elseif (strpos($class, 'CI_DB') === 0) |
|
103 | 96 | { |
104 | 97 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
105 | 98 | $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
106 | - } |
|
107 | - else |
|
99 | + } else |
|
108 | 100 | { |
109 | 101 | $class = strtolower($class); |
110 | 102 | } |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | private static function checkConfigurationFile($file) |
115 | 115 | { |
116 | - if (!file_exists($file)) { |
|
116 | + if ( ! file_exists($file)) { |
|
117 | 117 | throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
118 | 118 | } |
119 | 119 |
@@ -52,71 +52,71 @@ |
||
52 | 52 | */ |
53 | 53 | final class TestSuiteProvider |
54 | 54 | { |
55 | - /** |
|
56 | - * phpunit configuration file |
|
57 | - * |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - private static $file; |
|
55 | + /** |
|
56 | + * phpunit configuration file |
|
57 | + * |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + private static $file; |
|
61 | 61 | |
62 | - /** |
|
63 | - * constructor |
|
64 | - */ |
|
65 | - private function __construct() {} |
|
62 | + /** |
|
63 | + * constructor |
|
64 | + */ |
|
65 | + private function __construct() {} |
|
66 | 66 | |
67 | - /** |
|
68 | - * set the phpunit configuration file |
|
69 | - * |
|
70 | - * @param string $file the path or filename of the phunit configuration file |
|
71 | - */ |
|
72 | - public static function setConfigurationFile($file) |
|
73 | - { |
|
74 | - static::$file = $file; |
|
75 | - } |
|
67 | + /** |
|
68 | + * set the phpunit configuration file |
|
69 | + * |
|
70 | + * @param string $file the path or filename of the phunit configuration file |
|
71 | + */ |
|
72 | + public static function setConfigurationFile($file) |
|
73 | + { |
|
74 | + static::$file = $file; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * get the phpunit test suite instance |
|
79 | - * |
|
80 | - * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
81 | - * @throws FileNotFoundException if the file is not found |
|
82 | - */ |
|
83 | - public static function suite() |
|
84 | - { |
|
85 | - $file = static::checkConfigurationFile( |
|
86 | - static::getConfigurationFile() |
|
87 | - ); |
|
77 | + /** |
|
78 | + * get the phpunit test suite instance |
|
79 | + * |
|
80 | + * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
81 | + * @throws FileNotFoundException if the file is not found |
|
82 | + */ |
|
83 | + public static function suite() |
|
84 | + { |
|
85 | + $file = static::checkConfigurationFile( |
|
86 | + static::getConfigurationFile() |
|
87 | + ); |
|
88 | 88 | |
89 | - return PHPUnit_Util_Configuration::getInstance($file) |
|
90 | - ->getTestSuiteConfiguration(); |
|
91 | - } |
|
89 | + return PHPUnit_Util_Configuration::getInstance($file) |
|
90 | + ->getTestSuiteConfiguration(); |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * get the phpunit configuration file |
|
95 | - * |
|
96 | - * @return string |
|
97 | - */ |
|
98 | - private static function getConfigurationFile() |
|
99 | - { |
|
100 | - static::$file = isset(static::$file) |
|
101 | - ? static::$file |
|
102 | - : APPPATH.'tests/phpunit.xml'; |
|
93 | + /** |
|
94 | + * get the phpunit configuration file |
|
95 | + * |
|
96 | + * @return string |
|
97 | + */ |
|
98 | + private static function getConfigurationFile() |
|
99 | + { |
|
100 | + static::$file = isset(static::$file) |
|
101 | + ? static::$file |
|
102 | + : APPPATH.'tests/phpunit.xml'; |
|
103 | 103 | |
104 | - return static::$file; |
|
105 | - } |
|
104 | + return static::$file; |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * check the given file |
|
109 | - * |
|
110 | - * @param string $file file to check |
|
111 | - * @return string returns the file if it is valid |
|
112 | - * @throws FileNotFoundException if the file is not found |
|
113 | - */ |
|
114 | - private static function checkConfigurationFile($file) |
|
115 | - { |
|
116 | - if (!file_exists($file)) { |
|
117 | - throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
118 | - } |
|
107 | + /** |
|
108 | + * check the given file |
|
109 | + * |
|
110 | + * @param string $file file to check |
|
111 | + * @return string returns the file if it is valid |
|
112 | + * @throws FileNotFoundException if the file is not found |
|
113 | + */ |
|
114 | + private static function checkConfigurationFile($file) |
|
115 | + { |
|
116 | + if (!file_exists($file)) { |
|
117 | + throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
118 | + } |
|
119 | 119 | |
120 | - return $file; |
|
121 | - } |
|
120 | + return $file; |
|
121 | + } |
|
122 | 122 | } |