Completed
Pull Request — master (#274)
by
unknown
02:28
created
application/tests/Bootstrap.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  * NOTE: If you change these, also change the error_reporting() code below
55 55
  */
56 56
 // This `if` statemant is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
57
+if ( ! defined('ENVIRONMENT'))
58 58
 {
59 59
 	define('ENVIRONMENT', 'testing');
60 60
 }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
233 233
 
234 234
 	// Path to the test directory containing all the test files.
235
-	define('TESTPATH', __dir__.DIRECTORY_SEPARATOR);  // Should be the folder this `Bootstrap.php` file is in.
235
+	define('TESTPATH', __dir__.DIRECTORY_SEPARATOR); // Should be the folder this `Bootstrap.php` file is in.
236 236
 
237 237
 	// Path to the system directory
238 238
 	define('BASEPATH', $system_path);
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);
315 315
 
316 316
 	// Path to the ci-phpunit-test directory
317
-	if (is_dir(TESTPATH . '_ci_phpunit_test'))
317
+	if (is_dir(TESTPATH.'_ci_phpunit_test'))
318 318
 	{
319
-		define('CI_PHPUNIT_TESTPATH', TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR);
319
+		define('CI_PHPUNIT_TESTPATH', TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR);
320 320
 	}
321 321
 	else
322 322
 	{
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
380 380
 */
381 381
 
382
-require CI_PHPUNIT_TESTPATH . '/CIPHPUnitTest.php';
382
+require CI_PHPUNIT_TESTPATH.'/CIPHPUnitTest.php';
383 383
 
384 384
 CIPHPUnitTest::init();
385 385
 // Or you can set directories for autoloading
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
 		if (version_compare(PHP_VERSION, '5.3', '>='))
81 81
 		{
82 82
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
83
-		}
84
-		else
83
+		} else
85 84
 		{
86 85
 			error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
87 86
 		}
@@ -204,8 +203,7 @@  discard block
 block discarded – undo
204 203
 	if (($_temp = realpath($system_path)) !== FALSE)
205 204
 	{
206 205
 		$system_path = $_temp.DIRECTORY_SEPARATOR;
207
-	}
208
-	else
206
+	} else
209 207
 	{
210 208
 		// Ensure there's a trailing slash
211 209
 		$system_path = strtr(
@@ -249,8 +247,7 @@  discard block
 block discarded – undo
249 247
 		if (($_temp = realpath($application_folder)) !== FALSE)
250 248
 		{
251 249
 			$application_folder = $_temp;
252
-		}
253
-		else
250
+		} else
254 251
 		{
255 252
 			$application_folder = strtr(
256 253
 				rtrim($application_folder, '/\\'),
@@ -258,16 +255,14 @@  discard block
 block discarded – undo
258 255
 				DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
259 256
 			);
260 257
 		}
261
-	}
262
-	elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
258
+	} elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
263 259
 	{
264 260
 		$application_folder = BASEPATH.strtr(
265 261
 			trim($application_folder, '/\\'),
266 262
 			'/\\',
267 263
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
268 264
 		);
269
-	}
270
-	else
265
+	} else
271 266
 	{
272 267
 		header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
273 268
 		echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
@@ -280,14 +275,12 @@  discard block
 block discarded – undo
280 275
 	if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
281 276
 	{
282 277
 		$view_folder = APPPATH.'views';
283
-	}
284
-	elseif (is_dir($view_folder))
278
+	} elseif (is_dir($view_folder))
285 279
 	{
286 280
 		if (($_temp = realpath($view_folder)) !== FALSE)
287 281
 		{
288 282
 			$view_folder = $_temp;
289
-		}
290
-		else
283
+		} else
291 284
 		{
292 285
 			$view_folder = strtr(
293 286
 				rtrim($view_folder, '/\\'),
@@ -295,16 +288,14 @@  discard block
 block discarded – undo
295 288
 				DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
296 289
 			);
297 290
 		}
298
-	}
299
-	elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
291
+	} elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
300 292
 	{
301 293
 		$view_folder = APPPATH.strtr(
302 294
 			trim($view_folder, '/\\'),
303 295
 			'/\\',
304 296
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
305 297
 		);
306
-	}
307
-	else
298
+	} else
308 299
 	{
309 300
 		header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
310 301
 		echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
@@ -317,8 +308,7 @@  discard block
 block discarded – undo
317 308
 	if (is_dir(TESTPATH . '_ci_phpunit_test'))
318 309
 	{
319 310
 		define('CI_PHPUNIT_TESTPATH', TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR);
320
-	}
321
-	else
311
+	} else
322 312
 	{
323 313
 		// Assume Composer with a vendor directory parallel to the application directory
324 314
 		define('CI_PHPUNIT_TESTPATH', implode(
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/Loader.php 1 patch
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			{
@@ -315,8 +312,7 @@  discard block
 block discarded – undo
315 312
 				}
316 313
 
317 314
 				log_message('info', 'CI_Model class loaded');
318
-			}
319
-			elseif ( ! class_exists('CI_Model', FALSE))
315
+			} elseif ( ! class_exists('CI_Model', FALSE))
320 316
 			{
321 317
 				require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php');
322 318
 			}
@@ -477,8 +473,7 @@  discard block
 block discarded – undo
477 473
 				require_once($driver_path);
478 474
 				$class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge';
479 475
 			}
480
-		}
481
-		else
476
+		} else
482 477
 		{
483 478
 			$class = 'CI_DB_'.$db->dbdriver.'_forge';
484 479
 		}
@@ -765,16 +760,14 @@  discard block
 block discarded – undo
765 760
 				if (is_int($key))
766 761
 				{
767 762
 					$this->driver($value, $params);
768
-				}
769
-				else
763
+				} else
770 764
 				{
771 765
 					$this->driver($key, $params, $value);
772 766
 				}
773 767
 			}
774 768
 
775 769
 			return $this;
776
-		}
777
-		elseif (empty($library))
770
+		} elseif (empty($library))
778 771
 		{
779 772
 			return FALSE;
780 773
 		}
@@ -873,8 +866,7 @@  discard block
 block discarded – undo
873 866
 			array_shift($this->_ci_helper_paths);
874 867
 			array_shift($this->_ci_view_paths);
875 868
 			array_pop($config->_config_paths);
876
-		}
877
-		else
869
+		} else
878 870
 		{
879 871
 			$path = rtrim($path, '/').'/';
880 872
 			foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var)
@@ -938,8 +930,7 @@  discard block
 block discarded – undo
938 930
 		{
939 931
 			$_ci_x = explode('/', $_ci_path);
940 932
 			$_ci_file = end($_ci_x);
941
-		}
942
-		else
933
+		} else
943 934
 		{
944 935
 			$_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION);
945 936
 			$_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view;
@@ -1006,8 +997,7 @@  discard block
 block discarded – undo
1006 997
 		if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE)
1007 998
 		{
1008 999
 			echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
1009
-		}
1010
-		else
1000
+		} else
1011 1001
 		{
1012 1002
 			include($_ci_path); // include() vs include_once() allows for multiple views with the same name
1013 1003
 		}
@@ -1034,8 +1024,7 @@  discard block
 block discarded – undo
1034 1024
 		if (ob_get_level() > $this->_ci_ob_level + 1)
1035 1025
 		{
1036 1026
 			ob_end_flush();
1037
-		}
1038
-		else
1027
+		} else
1039 1028
 		{
1040 1029
 			$_ci_CI->output->append_output(ob_get_contents());
1041 1030
 			@ob_end_clean();
@@ -1075,8 +1064,7 @@  discard block
 block discarded – undo
1075 1064
 
1076 1065
 			// Get the filename from the path
1077 1066
 			$class = substr($class, $last_slash);
1078
-		}
1079
-		else
1067
+		} else
1080 1068
 		{
1081 1069
 			$subdir = '';
1082 1070
 		}
@@ -1214,8 +1202,7 @@  discard block
 block discarded – undo
1214 1202
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1215 1203
 		{
1216 1204
 			include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php');
1217
-		}
1218
-		else
1205
+		} else
1219 1206
 		{
1220 1207
 			include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php');
1221 1208
 		}
@@ -1279,8 +1266,7 @@  discard block
 block discarded – undo
1279 1266
 					{
1280 1267
 						include($path.'config/'.strtolower($class).'.php');
1281 1268
 						$found = TRUE;
1282
-					}
1283
-					elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1269
+					} elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1284 1270
 					{
1285 1271
 						include($path.'config/'.ucfirst(strtolower($class)).'.php');
1286 1272
 						$found = TRUE;
@@ -1290,8 +1276,7 @@  discard block
 block discarded – undo
1290 1276
 					{
1291 1277
 						include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php');
1292 1278
 						$found = TRUE;
1293
-					}
1294
-					elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1279
+					} elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1295 1280
 					{
1296 1281
 						include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php');
1297 1282
 						$found = TRUE;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/old/3.1.4-Loader.php 1 patch
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
1210 1198
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1211 1199
 		{
1212 1200
 			include_once(CI_PHPUNIT_TESTPATH.'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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/old/3.1.2-Loader.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
@@ -1013,8 +1004,7 @@  discard block
 block discarded – undo
1013 1004
 		if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE)
1014 1005
 		{
1015 1006
 			echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
1016
-		}
1017
-		else
1007
+		} else
1018 1008
 		{
1019 1009
 			include($_ci_path); // include() vs include_once() allows for multiple views with the same name
1020 1010
 		}
@@ -1041,8 +1031,7 @@  discard block
 block discarded – undo
1041 1031
 		if (ob_get_level() > $this->_ci_ob_level + 1)
1042 1032
 		{
1043 1033
 			ob_end_flush();
1044
-		}
1045
-		else
1034
+		} else
1046 1035
 		{
1047 1036
 			$_ci_CI->output->append_output(ob_get_contents());
1048 1037
 			@ob_end_clean();
@@ -1082,8 +1071,7 @@  discard block
 block discarded – undo
1082 1071
 
1083 1072
 			// Get the filename from the path
1084 1073
 			$class = substr($class, $last_slash);
1085
-		}
1086
-		else
1074
+		} else
1087 1075
 		{
1088 1076
 			$subdir = '';
1089 1077
 		}
@@ -1221,8 +1209,7 @@  discard block
 block discarded – undo
1221 1209
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1222 1210
 		{
1223 1211
 			include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php');
1224
-		}
1225
-		else
1212
+		} else
1226 1213
 		{
1227 1214
 			include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php');
1228 1215
 		}
@@ -1238,8 +1225,7 @@  discard block
 block discarded – undo
1238 1225
 				{
1239 1226
 					$prefix = config_item('subclass_prefix');
1240 1227
 					break;
1241
-				}
1242
-				else
1228
+				} else
1243 1229
 				{
1244 1230
 					log_message('debug', $path.' exists, but does not declare '.$subclass);
1245 1231
 				}
@@ -1288,8 +1274,7 @@  discard block
 block discarded – undo
1288 1274
 					{
1289 1275
 						include($path.'config/'.strtolower($class).'.php');
1290 1276
 						$found = TRUE;
1291
-					}
1292
-					elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1277
+					} elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1293 1278
 					{
1294 1279
 						include($path.'config/'.ucfirst(strtolower($class)).'.php');
1295 1280
 						$found = TRUE;
@@ -1299,8 +1284,7 @@  discard block
 block discarded – undo
1299 1284
 					{
1300 1285
 						include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php');
1301 1286
 						$found = TRUE;
1302
-					}
1303
-					elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1287
+					} elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1304 1288
 					{
1305 1289
 						include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php');
1306 1290
 						$found = TRUE;
@@ -1496,8 +1480,7 @@  discard block
 block discarded – undo
1496 1480
 		if ( ! is_array($filename))
1497 1481
 		{
1498 1482
 			return array(strtolower(str_replace(array($extension, '.php'), '', $filename).$extension));
1499
-		}
1500
-		else
1483
+		} else
1501 1484
 		{
1502 1485
 			foreach ($filename as $key => $val)
1503 1486
 			{
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/old/3.1.6-Loader.php 1 patch
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
@@ -759,16 +754,14 @@  discard block
 block discarded – undo
759 754
 				if (is_int($key))
760 755
 				{
761 756
 					$this->driver($value, $params);
762
-				}
763
-				else
757
+				} else
764 758
 				{
765 759
 					$this->driver($key, $params, $value);
766 760
 				}
767 761
 			}
768 762
 
769 763
 			return $this;
770
-		}
771
-		elseif (empty($library))
764
+		} elseif (empty($library))
772 765
 		{
773 766
 			return FALSE;
774 767
 		}
@@ -867,8 +860,7 @@  discard block
 block discarded – undo
867 860
 			array_shift($this->_ci_helper_paths);
868 861
 			array_shift($this->_ci_view_paths);
869 862
 			array_pop($config->_config_paths);
870
-		}
871
-		else
863
+		} else
872 864
 		{
873 865
 			$path = rtrim($path, '/').'/';
874 866
 			foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var)
@@ -932,8 +924,7 @@  discard block
 block discarded – undo
932 924
 		{
933 925
 			$_ci_x = explode('/', $_ci_path);
934 926
 			$_ci_file = end($_ci_x);
935
-		}
936
-		else
927
+		} else
937 928
 		{
938 929
 			$_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION);
939 930
 			$_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view;
@@ -1000,8 +991,7 @@  discard block
 block discarded – undo
1000 991
 		if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE)
1001 992
 		{
1002 993
 			echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
1003
-		}
1004
-		else
994
+		} else
1005 995
 		{
1006 996
 			include($_ci_path); // include() vs include_once() allows for multiple views with the same name
1007 997
 		}
@@ -1028,8 +1018,7 @@  discard block
 block discarded – undo
1028 1018
 		if (ob_get_level() > $this->_ci_ob_level + 1)
1029 1019
 		{
1030 1020
 			ob_end_flush();
1031
-		}
1032
-		else
1021
+		} else
1033 1022
 		{
1034 1023
 			$_ci_CI->output->append_output(ob_get_contents());
1035 1024
 			@ob_end_clean();
@@ -1069,8 +1058,7 @@  discard block
 block discarded – undo
1069 1058
 
1070 1059
 			// Get the filename from the path
1071 1060
 			$class = substr($class, $last_slash);
1072
-		}
1073
-		else
1061
+		} else
1074 1062
 		{
1075 1063
 			$subdir = '';
1076 1064
 		}
@@ -1208,8 +1196,7 @@  discard block
 block discarded – undo
1208 1196
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1209 1197
 		{
1210 1198
 			include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php');
1211
-		}
1212
-		else
1199
+		} else
1213 1200
 		{
1214 1201
 			include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php');
1215 1202
 		}
@@ -1273,8 +1260,7 @@  discard block
 block discarded – undo
1273 1260
 					{
1274 1261
 						include($path.'config/'.strtolower($class).'.php');
1275 1262
 						$found = TRUE;
1276
-					}
1277
-					elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1263
+					} elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1278 1264
 					{
1279 1265
 						include($path.'config/'.ucfirst(strtolower($class)).'.php');
1280 1266
 						$found = TRUE;
@@ -1284,8 +1270,7 @@  discard block
 block discarded – undo
1284 1270
 					{
1285 1271
 						include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php');
1286 1272
 						$found = TRUE;
1287
-					}
1288
-					elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1273
+					} elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1289 1274
 					{
1290 1275
 						include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php');
1291 1276
 						$found = TRUE;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 		if (! defined('TESTPATH')) {
24 24
 			define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
25 25
 		}
26
-        // Current Bootstrap.php should define this, but in case it doesn't:
26
+		// Current Bootstrap.php should define this, but in case it doesn't:
27 27
 		if (! defined('CI_PHPUNIT_TESTPATH')) {
28 28
 			define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
29 29
 		}
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	public static function init(array $autoload_dirs = null)
22 22
 	{
23
-		if (! defined('TESTPATH')) {
23
+		if ( ! defined('TESTPATH')) {
24 24
 			define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
25 25
 		}
26 26
         // Current Bootstrap.php should define this, but in case it doesn't:
27
-		if (! defined('CI_PHPUNIT_TESTPATH')) {
27
+		if ( ! defined('CI_PHPUNIT_TESTPATH')) {
28 28
 			define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
29 29
 		}
30 30
 
@@ -41,38 +41,38 @@  discard block
 block discarded – undo
41 41
 		$cwd_backup = getcwd();
42 42
 
43 43
 		// Load autoloader for ci-phpunit-test
44
-		require __DIR__ . '/autoloader.php';
44
+		require __DIR__.'/autoloader.php';
45 45
 
46
-		require TESTPATH . 'TestCase.php';
46
+		require TESTPATH.'TestCase.php';
47 47
 
48
-		$db_test_case_file = TESTPATH . 'DbTestCase.php';
48
+		$db_test_case_file = TESTPATH.'DbTestCase.php';
49 49
 		if (is_readable($db_test_case_file))
50 50
 		{
51 51
 			require $db_test_case_file;
52 52
 		}
53 53
 
54
-		$unit_test_case_file = TESTPATH . 'UnitTestCase.php';
54
+		$unit_test_case_file = TESTPATH.'UnitTestCase.php';
55 55
 		if (is_readable($unit_test_case_file))
56 56
 		{
57 57
 			require $unit_test_case_file;
58 58
 		}
59 59
 
60 60
 		// Replace a few Common functions
61
-		require __DIR__ . '/replacing/core/Common.php';
62
-		require BASEPATH . 'core/Common.php';
61
+		require __DIR__.'/replacing/core/Common.php';
62
+		require BASEPATH.'core/Common.php';
63 63
 
64 64
 		// Workaround for missing CodeIgniter's error handler
65 65
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
66 66
 		set_error_handler('_error_handler');
67 67
 
68 68
 		// Load new functions of CIPHPUnitTest
69
-		require __DIR__ . '/functions.php';
69
+		require __DIR__.'/functions.php';
70 70
 		// Load ci-phpunit-test CI_Loader
71
-		require __DIR__ . '/replacing/core/Loader.php';
71
+		require __DIR__.'/replacing/core/Loader.php';
72 72
 		// Load ci-phpunit-test CI_Input
73
-		require __DIR__ . '/replacing/core/Input.php';
73
+		require __DIR__.'/replacing/core/Input.php';
74 74
 		// Load ci-phpunit-test CI_Output
75
-		require __DIR__ . '/replacing/core/Output.php';
75
+		require __DIR__.'/replacing/core/Output.php';
76 76
 
77 77
 		// Change current directory
78 78
 		chdir(FCPATH);
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 		 *
85 85
 		 * And away we go...
86 86
 		 */
87
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
87
+		require __DIR__.'/replacing/core/CodeIgniter.php';
88 88
 
89 89
 		self::replaceHelpers();
90 90
 
91 91
 		// Create CodeIgniter instance
92
-		if (! self::wiredesignzHmvcInstalled())
92
+		if ( ! self::wiredesignzHmvcInstalled())
93 93
 		{
94 94
 			new CI_Controller();
95 95
 		}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 	public static function createCodeIgniterInstance()
112 112
 	{
113
-		if (! self::wiredesignzHmvcInstalled())
113
+		if ( ! self::wiredesignzHmvcInstalled())
114 114
 		{
115 115
 			new CI_Controller();
116 116
 		}
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 	protected static function replaceLoader()
140 140
 	{
141 141
 		$my_loader_file =
142
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
142
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
143 143
 
144 144
 		if (file_exists($my_loader_file))
145 145
 		{
146
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
146
+			self::$loader_class = config_item('subclass_prefix').'Loader';
147 147
 			if ( ! class_exists(self::$loader_class))
148 148
 			{
149 149
 				require $my_loader_file;
@@ -162,19 +162,19 @@  discard block
 block discarded – undo
162 162
 
163 163
 	protected static function loadHelper($helper)
164 164
 	{
165
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php';
165
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
166 166
 		if (file_exists($my_helper_file))
167 167
 		{
168 168
 			require $my_helper_file;
169 169
 		}
170
-		require __DIR__ . '/replacing/helpers/' . $helper . '.php';
170
+		require __DIR__.'/replacing/helpers/'.$helper.'.php';
171 171
 	}
172 172
 
173 173
 	public static function setPatcherCacheDir($dir = null)
174 174
 	{
175 175
 		if ($dir === null)
176 176
 		{
177
-			$dir = CI_PHPUNIT_TESTPATH . 'tmp/cache';
177
+			$dir = CI_PHPUNIT_TESTPATH.'tmp/cache';
178 178
 		}
179 179
 
180 180
 		MonkeyPatchManager::setCacheDir(
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/old/3.1.7-Loader.php 1 patch
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			{
@@ -315,8 +312,7 @@  discard block
 block discarded – undo
315 312
 				}
316 313
 
317 314
 				log_message('info', 'CI_Model class loaded');
318
-			}
319
-			elseif ( ! class_exists('CI_Model', FALSE))
315
+			} elseif ( ! class_exists('CI_Model', FALSE))
320 316
 			{
321 317
 				require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php');
322 318
 			}
@@ -477,8 +473,7 @@  discard block
 block discarded – undo
477 473
 				require_once($driver_path);
478 474
 				$class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge';
479 475
 			}
480
-		}
481
-		else
476
+		} else
482 477
 		{
483 478
 			$class = 'CI_DB_'.$db->dbdriver.'_forge';
484 479
 		}
@@ -765,16 +760,14 @@  discard block
 block discarded – undo
765 760
 				if (is_int($key))
766 761
 				{
767 762
 					$this->driver($value, $params);
768
-				}
769
-				else
763
+				} else
770 764
 				{
771 765
 					$this->driver($key, $params, $value);
772 766
 				}
773 767
 			}
774 768
 
775 769
 			return $this;
776
-		}
777
-		elseif (empty($library))
770
+		} elseif (empty($library))
778 771
 		{
779 772
 			return FALSE;
780 773
 		}
@@ -873,8 +866,7 @@  discard block
 block discarded – undo
873 866
 			array_shift($this->_ci_helper_paths);
874 867
 			array_shift($this->_ci_view_paths);
875 868
 			array_pop($config->_config_paths);
876
-		}
877
-		else
869
+		} else
878 870
 		{
879 871
 			$path = rtrim($path, '/').'/';
880 872
 			foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var)
@@ -938,8 +930,7 @@  discard block
 block discarded – undo
938 930
 		{
939 931
 			$_ci_x = explode('/', $_ci_path);
940 932
 			$_ci_file = end($_ci_x);
941
-		}
942
-		else
933
+		} else
943 934
 		{
944 935
 			$_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION);
945 936
 			$_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view;
@@ -1006,8 +997,7 @@  discard block
 block discarded – undo
1006 997
 		if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE)
1007 998
 		{
1008 999
 			echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
1009
-		}
1010
-		else
1000
+		} else
1011 1001
 		{
1012 1002
 			include($_ci_path); // include() vs include_once() allows for multiple views with the same name
1013 1003
 		}
@@ -1034,8 +1024,7 @@  discard block
 block discarded – undo
1034 1024
 		if (ob_get_level() > $this->_ci_ob_level + 1)
1035 1025
 		{
1036 1026
 			ob_end_flush();
1037
-		}
1038
-		else
1027
+		} else
1039 1028
 		{
1040 1029
 			$_ci_CI->output->append_output(ob_get_contents());
1041 1030
 			@ob_end_clean();
@@ -1075,8 +1064,7 @@  discard block
 block discarded – undo
1075 1064
 
1076 1065
 			// Get the filename from the path
1077 1066
 			$class = substr($class, $last_slash);
1078
-		}
1079
-		else
1067
+		} else
1080 1068
 		{
1081 1069
 			$subdir = '';
1082 1070
 		}
@@ -1214,8 +1202,7 @@  discard block
 block discarded – undo
1214 1202
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1215 1203
 		{
1216 1204
 			include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php');
1217
-		}
1218
-		else
1205
+		} else
1219 1206
 		{
1220 1207
 			include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php');
1221 1208
 		}
@@ -1279,8 +1266,7 @@  discard block
 block discarded – undo
1279 1266
 					{
1280 1267
 						include($path.'config/'.strtolower($class).'.php');
1281 1268
 						$found = TRUE;
1282
-					}
1283
-					elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1269
+					} elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1284 1270
 					{
1285 1271
 						include($path.'config/'.ucfirst(strtolower($class)).'.php');
1286 1272
 						$found = TRUE;
@@ -1290,8 +1276,7 @@  discard block
 block discarded – undo
1290 1276
 					{
1291 1277
 						include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php');
1292 1278
 						$found = TRUE;
1293
-					}
1294
-					elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1279
+					} elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1295 1280
 					{
1296 1281
 						include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php');
1297 1282
 						$found = TRUE;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/old/3.1.8-Loader.php 1 patch
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			{
@@ -315,8 +312,7 @@  discard block
 block discarded – undo
315 312
 				}
316 313
 
317 314
 				log_message('info', 'CI_Model class loaded');
318
-			}
319
-			elseif ( ! class_exists('CI_Model', FALSE))
315
+			} elseif ( ! class_exists('CI_Model', FALSE))
320 316
 			{
321 317
 				require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php');
322 318
 			}
@@ -477,8 +473,7 @@  discard block
 block discarded – undo
477 473
 				require_once($driver_path);
478 474
 				$class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge';
479 475
 			}
480
-		}
481
-		else
476
+		} else
482 477
 		{
483 478
 			$class = 'CI_DB_'.$db->dbdriver.'_forge';
484 479
 		}
@@ -765,16 +760,14 @@  discard block
 block discarded – undo
765 760
 				if (is_int($key))
766 761
 				{
767 762
 					$this->driver($value, $params);
768
-				}
769
-				else
763
+				} else
770 764
 				{
771 765
 					$this->driver($key, $params, $value);
772 766
 				}
773 767
 			}
774 768
 
775 769
 			return $this;
776
-		}
777
-		elseif (empty($library))
770
+		} elseif (empty($library))
778 771
 		{
779 772
 			return FALSE;
780 773
 		}
@@ -873,8 +866,7 @@  discard block
 block discarded – undo
873 866
 			array_shift($this->_ci_helper_paths);
874 867
 			array_shift($this->_ci_view_paths);
875 868
 			array_pop($config->_config_paths);
876
-		}
877
-		else
869
+		} else
878 870
 		{
879 871
 			$path = rtrim($path, '/').'/';
880 872
 			foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var)
@@ -938,8 +930,7 @@  discard block
 block discarded – undo
938 930
 		{
939 931
 			$_ci_x = explode('/', $_ci_path);
940 932
 			$_ci_file = end($_ci_x);
941
-		}
942
-		else
933
+		} else
943 934
 		{
944 935
 			$_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION);
945 936
 			$_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view;
@@ -1006,8 +997,7 @@  discard block
 block discarded – undo
1006 997
 		if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE)
1007 998
 		{
1008 999
 			echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
1009
-		}
1010
-		else
1000
+		} else
1011 1001
 		{
1012 1002
 			include($_ci_path); // include() vs include_once() allows for multiple views with the same name
1013 1003
 		}
@@ -1034,8 +1024,7 @@  discard block
 block discarded – undo
1034 1024
 		if (ob_get_level() > $this->_ci_ob_level + 1)
1035 1025
 		{
1036 1026
 			ob_end_flush();
1037
-		}
1038
-		else
1027
+		} else
1039 1028
 		{
1040 1029
 			$_ci_CI->output->append_output(ob_get_contents());
1041 1030
 			@ob_end_clean();
@@ -1075,8 +1064,7 @@  discard block
 block discarded – undo
1075 1064
 
1076 1065
 			// Get the filename from the path
1077 1066
 			$class = substr($class, $last_slash);
1078
-		}
1079
-		else
1067
+		} else
1080 1068
 		{
1081 1069
 			$subdir = '';
1082 1070
 		}
@@ -1214,8 +1202,7 @@  discard block
 block discarded – undo
1214 1202
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1215 1203
 		{
1216 1204
 			include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php');
1217
-		}
1218
-		else
1205
+		} else
1219 1206
 		{
1220 1207
 			include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php');
1221 1208
 		}
@@ -1279,8 +1266,7 @@  discard block
 block discarded – undo
1279 1266
 					{
1280 1267
 						include($path.'config/'.strtolower($class).'.php');
1281 1268
 						$found = TRUE;
1282
-					}
1283
-					elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1269
+					} elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php'))
1284 1270
 					{
1285 1271
 						include($path.'config/'.ucfirst(strtolower($class)).'.php');
1286 1272
 						$found = TRUE;
@@ -1290,8 +1276,7 @@  discard block
 block discarded – undo
1290 1276
 					{
1291 1277
 						include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php');
1292 1278
 						$found = TRUE;
1293
-					}
1294
-					elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1279
+					} elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'))
1295 1280
 					{
1296 1281
 						include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php');
1297 1282
 						$found = TRUE;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/old/3.1.3-Loader.php 1 patch
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -200,16 +200,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
1210 1198
 		if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'))
1211 1199
 		{
1212 1200
 			include_once(CI_PHPUNIT_TESTPATH.'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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.