@@ -67,8 +67,7 @@ |
||
67 | 67 | if ($this->offsetExists($key)) |
68 | 68 | { |
69 | 69 | return $this->map[$key]; |
70 | - } |
|
71 | - else |
|
70 | + } else |
|
72 | 71 | { |
73 | 72 | return null; |
74 | 73 | } |
@@ -29,16 +29,14 @@ |
||
29 | 29 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
30 | 30 | { |
31 | 31 | $e404 = TRUE; |
32 | - } |
|
33 | - else |
|
32 | + } else |
|
34 | 33 | { |
35 | 34 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
36 | 35 | |
37 | 36 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
38 | 37 | { |
39 | 38 | $e404 = TRUE; |
40 | - } |
|
41 | - elseif (method_exists($class, '_remap')) |
|
39 | + } elseif (method_exists($class, '_remap')) |
|
42 | 40 | { |
43 | 41 | $params = array($method, array_slice($URI->rsegments, 2)); |
44 | 42 | $method = '_remap'; |
@@ -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 |
@@ -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, |
@@ -60,8 +60,7 @@ |
||
60 | 60 | if (strpos($class_method, '::') === false) |
61 | 61 | { |
62 | 62 | return 'Kenjis\MonkeyPatch\Patcher\FunctionPatcher\Proxy'; |
63 | - } |
|
64 | - else |
|
63 | + } else |
|
65 | 64 | { |
66 | 65 | return 'Kenjis\MonkeyPatch\Patcher\MethodPatcher\PatchManager'; |
67 | 66 | } |
@@ -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,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 | { |
@@ -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 | } |
@@ -80,8 +80,7 @@ discard block |
||
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 |
||
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( |
@@ -247,8 +245,7 @@ discard block |
||
247 | 245 | if (($_temp = realpath($application_folder)) !== FALSE) |
248 | 246 | { |
249 | 247 | $application_folder = $_temp; |
250 | - } |
|
251 | - else |
|
248 | + } else |
|
252 | 249 | { |
253 | 250 | $application_folder = strtr( |
254 | 251 | rtrim($application_folder, '/\\'), |
@@ -256,16 +253,14 @@ discard block |
||
256 | 253 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
257 | 254 | ); |
258 | 255 | } |
259 | - } |
|
260 | - elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
256 | + } elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
261 | 257 | { |
262 | 258 | $application_folder = BASEPATH.strtr( |
263 | 259 | trim($application_folder, '/\\'), |
264 | 260 | '/\\', |
265 | 261 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
266 | 262 | ); |
267 | - } |
|
268 | - else |
|
263 | + } else |
|
269 | 264 | { |
270 | 265 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
271 | 266 | echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |
@@ -278,14 +273,12 @@ discard block |
||
278 | 273 | if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
279 | 274 | { |
280 | 275 | $view_folder = APPPATH.'views'; |
281 | - } |
|
282 | - elseif (is_dir($view_folder)) |
|
276 | + } elseif (is_dir($view_folder)) |
|
283 | 277 | { |
284 | 278 | if (($_temp = realpath($view_folder)) !== FALSE) |
285 | 279 | { |
286 | 280 | $view_folder = $_temp; |
287 | - } |
|
288 | - else |
|
281 | + } else |
|
289 | 282 | { |
290 | 283 | $view_folder = strtr( |
291 | 284 | rtrim($view_folder, '/\\'), |
@@ -293,16 +286,14 @@ discard block |
||
293 | 286 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
294 | 287 | ); |
295 | 288 | } |
296 | - } |
|
297 | - elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
289 | + } elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
298 | 290 | { |
299 | 291 | $view_folder = APPPATH.strtr( |
300 | 292 | trim($view_folder, '/\\'), |
301 | 293 | '/\\', |
302 | 294 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
303 | 295 | ); |
304 | - } |
|
305 | - else |
|
296 | + } else |
|
306 | 297 | { |
307 | 298 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
308 | 299 | echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |