Completed
Pull Request — master (#161)
by Kenji
02:26
created
application/tests/_ci_phpunit_test/patcher/functions/exit__.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/helpers/url_helper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,16 +63,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			{
Please login to merge, or discard this patch.
application/tests/mocks/autoloader.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestFileCache.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
 		{
39 39
 			$patched = true;
40 40
 			$new_source = static::generateNewSource($source);
41
-		}
42
-		else
41
+		} else
43 42
 		{
44 43
 			$new_source = $source;
45 44
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/functions.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
 		{
39 39
 			$patched = true;
40 40
 			$new_source = static::generateNewSource($source);
41
-		}
42
-		else
41
+		} else
43 42
 		{
44 43
 			$new_source = $source;
45 44
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/MonkeyPatch.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
 		{
39 39
 			$patched = true;
40 40
 			$new_source = static::generateNewSource($source);
41
-		}
42
-		else
41
+		} else
43 42
 		{
44 43
 			$new_source = $source;
45 44
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/MonkeyPatchManager.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
 		{
39 39
 			$patched = true;
40 40
 			$new_source = static::generateNewSource($source);
41
-		}
42
-		else
41
+		} else
43 42
 		{
44 43
 			$new_source = $source;
45 44
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@  discard block
 block discarded – undo
47 47
 					? $backtrace[$offset+2]['class']
48 48
 					: null;
49 49
 			$function = $backtrace[$offset+2]['function'];
50
-		}
51
-		else
50
+		} else
52 51
 		{
53 52
 			$class = null;
54 53
 			$function = null;
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
 			$method = $function;
60 59
 			$class_method = $class . '::' . $function;
61 60
 			$function = null;
62
-		}
63
-		else
61
+		} else
64 62
 		{
65 63
 			$method = null;
66 64
 			$class_method = null;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/Common.php 1 patch
Braces   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -158,14 +158,16 @@  discard block
 block discarded – undo
158 158
 	if ($status_code < 100)
159 159
 	{
160 160
 		$exit_status = $status_code + 9; // 9 is EXIT__AUTO_MIN
161
-		if ($exit_status > 125) // 125 is EXIT__AUTO_MAX
161
+		if ($exit_status > 125) {
162
+			// 125 is EXIT__AUTO_MAX
162 163
 		{
163
-			$exit_status = 1; // EXIT_ERROR
164
+			$exit_status = 1;
165
+		}
166
+		// EXIT_ERROR
164 167
 		}
165 168
 
166 169
 		$status_code = 500;
167
-	}
168
-	else
170
+	} else
169 171
 	{
170 172
 		$exit_status = 1; // EXIT_ERROR
171 173
 	}
@@ -254,8 +256,7 @@  discard block
 block discarded – undo
254 256
 		if (isset($stati[$code]))
255 257
 		{
256 258
 			$text = $stati[$code];
257
-		}
258
-		else
259
+		} else
259 260
 		{
260 261
 			show_error('No status text available. Please check your status code number or supply your own message text.', 500);
261 262
 		}
@@ -281,8 +282,7 @@  discard block
 block discarded – undo
281 282
 	if (strpos(PHP_SAPI, 'cgi') === 0)
282 283
 	{
283 284
 		header('Status: '.$code.' '.$text, TRUE);
284
-	}
285
-	else
285
+	} else
286 286
 	{
287 287
 		$server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
288 288
 		header($server_protocol.' '.$code.' '.$text, TRUE, $code);
@@ -325,8 +325,7 @@  discard block
 block discarded – undo
325 325
 		if (file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
326 326
 		{
327 327
 			require($file_path);
328
-		}
329
-		elseif ( ! $found)
328
+		} elseif ( ! $found)
330 329
 		{
331 330
 			set_status_header(503);
332 331
 			echo 'The configuration file does not exist.';
Please login to merge, or discard this patch.