Completed
Push — master ( 6612f8...4145fd )
by Angus
04:09
created
public/index.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  * Different environments will require different levels of error reporting.
64 64
  * By default development will show errors but testing and live will hide them.
65 65
  */
66
-switch (ENVIRONMENT)
66
+switch(ENVIRONMENT)
67 67
 {
68 68
 	case 'development':
69 69
 		error_reporting(-1);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	case 'testing':
80 80
 	case 'production':
81 81
 		ini_set('display_errors', 0);
82
-		if (version_compare(PHP_VERSION, '5.3', '>='))
82
+		if(version_compare(PHP_VERSION, '5.3', '>='))
83 83
 		{
84 84
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
85 85
 		}
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
  */
198 198
 
199 199
 // Set the current directory correctly for CLI requests
200
-if (defined('STDIN'))
200
+if(defined('STDIN'))
201 201
 {
202 202
 	chdir(dirname(__FILE__));
203 203
 }
204 204
 
205
-if (($_temp = realpath($system_path)) !== FALSE)
205
+if(($_temp = realpath($system_path)) !== FALSE)
206 206
 {
207 207
 	$system_path = $_temp.DIRECTORY_SEPARATOR;
208 208
 }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 }
218 218
 
219 219
 // Is the system path correct?
220
-if ( ! is_dir($system_path))
220
+if(!is_dir($system_path))
221 221
 {
222 222
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
223 223
 	echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 define('SYSDIR', basename(BASEPATH));
243 243
 
244 244
 // The path to the "application" directory
245
-if (is_dir($application_folder))
245
+if(is_dir($application_folder))
246 246
 {
247
-	if (($_temp = realpath($application_folder)) !== FALSE)
247
+	if(($_temp = realpath($application_folder)) !== FALSE)
248 248
 	{
249 249
 		$application_folder = $_temp;
250 250
 	}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		);
258 258
 	}
259 259
 }
260
-elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
260
+elseif(is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
261 261
 {
262 262
 	$application_folder = BASEPATH.strtr(
263 263
 			trim($application_folder, '/\\'),
@@ -275,13 +275,13 @@  discard block
 block discarded – undo
275 275
 define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
276 276
 
277 277
 // The path to the "views" directory
278
-if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
278
+if(!isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
279 279
 {
280 280
 	$view_folder = APPPATH.'views';
281 281
 }
282
-elseif (is_dir($view_folder))
282
+elseif(is_dir($view_folder))
283 283
 {
284
-	if (($_temp = realpath($view_folder)) !== FALSE)
284
+	if(($_temp = realpath($view_folder)) !== FALSE)
285 285
 	{
286 286
 		$view_folder = $_temp;
287 287
 	}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		);
295 295
 	}
296 296
 }
297
-elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
297
+elseif(is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
298 298
 {
299 299
 	$view_folder = APPPATH.strtr(
300 300
 			trim($view_folder, '/\\'),
Please login to merge, or discard this patch.
Braces   +18 added lines, -45 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
  * Different environments will require different levels of error reporting.
64 64
  * By default development will show errors but testing and live will hide them.
65 65
  */
66
-switch (ENVIRONMENT)
67
-{
66
+switch (ENVIRONMENT) {
68 67
 	case 'development':
69 68
 		error_reporting(-1);
70 69
 		ini_set('display_errors', 1);
@@ -79,12 +78,9 @@  discard block
 block discarded – undo
79 78
 	case 'testing':
80 79
 	case 'production':
81 80
 		ini_set('display_errors', 0);
82
-		if (version_compare(PHP_VERSION, '5.3', '>='))
83
-		{
81
+		if (version_compare(PHP_VERSION, '5.3', '>=')) {
84 82
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
85
-		}
86
-		else
87
-		{
83
+		} else {
88 84
 			error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
89 85
 		}
90 86
 		break;
@@ -197,17 +193,13 @@  discard block
 block discarded – undo
197 193
  */
198 194
 
199 195
 // Set the current directory correctly for CLI requests
200
-if (defined('STDIN'))
201
-{
196
+if (defined('STDIN')) {
202 197
 	chdir(dirname(__FILE__));
203 198
 }
204 199
 
205
-if (($_temp = realpath($system_path)) !== FALSE)
206
-{
200
+if (($_temp = realpath($system_path)) !== FALSE) {
207 201
 	$system_path = $_temp.DIRECTORY_SEPARATOR;
208
-}
209
-else
210
-{
202
+} else {
211 203
 	// Ensure there's a trailing slash
212 204
 	$system_path = strtr(
213 205
 		               rtrim($system_path, '/\\'),
@@ -217,8 +209,7 @@  discard block
 block discarded – undo
217 209
 }
218 210
 
219 211
 // Is the system path correct?
220
-if ( ! is_dir($system_path))
221
-{
212
+if ( ! is_dir($system_path)) {
222 213
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
223 214
 	echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
224 215
 	exit(3); // EXIT_CONFIG
@@ -242,31 +233,23 @@  discard block
 block discarded – undo
242 233
 define('SYSDIR', basename(BASEPATH));
243 234
 
244 235
 // The path to the "application" directory
245
-if (is_dir($application_folder))
246
-{
247
-	if (($_temp = realpath($application_folder)) !== FALSE)
248
-	{
236
+if (is_dir($application_folder)) {
237
+	if (($_temp = realpath($application_folder)) !== FALSE) {
249 238
 		$application_folder = $_temp;
250
-	}
251
-	else
252
-	{
239
+	} else {
253 240
 		$application_folder = strtr(
254 241
 			rtrim($application_folder, '/\\'),
255 242
 			'/\\',
256 243
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
257 244
 		);
258 245
 	}
259
-}
260
-elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
261
-{
246
+} elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) {
262 247
 	$application_folder = BASEPATH.strtr(
263 248
 			trim($application_folder, '/\\'),
264 249
 			'/\\',
265 250
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
266 251
 		);
267
-}
268
-else
269
-{
252
+} else {
270 253
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
271 254
 	echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
272 255
 	exit(3); // EXIT_CONFIG
@@ -275,35 +258,25 @@  discard block
 block discarded – undo
275 258
 define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
276 259
 
277 260
 // The path to the "views" directory
278
-if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
279
-{
261
+if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) {
280 262
 	$view_folder = APPPATH.'views';
281
-}
282
-elseif (is_dir($view_folder))
283
-{
284
-	if (($_temp = realpath($view_folder)) !== FALSE)
285
-	{
263
+} elseif (is_dir($view_folder)) {
264
+	if (($_temp = realpath($view_folder)) !== FALSE) {
286 265
 		$view_folder = $_temp;
287
-	}
288
-	else
289
-	{
266
+	} else {
290 267
 		$view_folder = strtr(
291 268
 			rtrim($view_folder, '/\\'),
292 269
 			'/\\',
293 270
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
294 271
 		);
295 272
 	}
296
-}
297
-elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
298
-{
273
+} elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) {
299 274
 	$view_folder = APPPATH.strtr(
300 275
 			trim($view_folder, '/\\'),
301 276
 			'/\\',
302 277
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
303 278
 		);
304
-}
305
-else
306
-{
279
+} else {
307 280
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
308 281
 	echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
309 282
 	exit(3); // EXIT_CONFIG
Please login to merge, or discard this patch.
application/tests/controllers/User/Auth/Login_test.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	public function test_index_logged_in() {
10 10
 		//user is already logged in, redirect to dashboard
11 11
 		$this->request->setCallablePreConstructor(
12
-			function () {
12
+			function() {
13 13
 				$ion_auth = $this->getMock_ion_auth_logged_in();
14 14
 				load_class_instance('ion_auth', $ion_auth);
15 15
 			}
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$this->markTestIncomplete('This test is broken for now.');
31 31
 
32 32
 		$this->request->setCallable(
33
-			function ($CI) {
33
+			function($CI) {
34 34
 				$validation = $this->getDouble(
35 35
 					'CI_Form_validation',
36 36
 					['set_rules' => NULL, 'run' => TRUE]
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			}
45 45
 		);
46 46
 		$this->request->addCallable(
47
-			function ($CI) {
47
+			function($CI) {
48 48
 				$user = $this->getDouble(
49 49
 					'User_Model',
50 50
 					['find_email_from_identity' => 'foobar']
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			}
57 57
 		);
58 58
 		$this->request->addCallable(
59
-			function ($CI) {
59
+			function($CI) {
60 60
 				$auth = $this->getDouble(
61 61
 					'Ion_auth_model',
62 62
 					['login' => TRUE]
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$this->markTestIncomplete('This test is broken for now.');
78 78
 
79 79
 		$this->request->setCallable(
80
-			function ($CI) {
80
+			function($CI) {
81 81
 				$validation = $this->getDouble(
82 82
 					'CI_Form_validation',
83 83
 					['set_rules' => NULL, 'run' => TRUE]
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 			}
92 92
 		);
93 93
 		$this->request->addCallable(
94
-			function ($CI) {
94
+			function($CI) {
95 95
 				$user = $this->getDouble(
96 96
 					'User_Model',
97 97
 					['find_email_from_identity' => 'foobar']
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			}
104 104
 		);
105 105
 		$this->request->addCallable(
106
-			function ($CI) {
106
+			function($CI) {
107 107
 				$auth = $this->getDouble(
108 108
 					'Ion_auth_model',
109 109
 					['login' => TRUE]
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 			}
116 116
 		);
117 117
 		$this->request->addCallable(
118
-			function ($CI) {
118
+			function($CI) {
119 119
 				// Get mock object
120 120
 				$session = $this->getDouble(
121 121
 					'CI_Session',
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	public function test_login_validation_fail() {
135 135
 		//user isn't logged in, validation failed, this is happens on the first time loading the page
136 136
 		$this->request->setCallable(
137
-			function ($CI) {
137
+			function($CI) {
138 138
 				// Get mock object
139 139
 				$validation = $this->getDouble(
140 140
 					'CI_Form_validation',
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	public function test_login_validation_pass_but_login_fail() {
157 157
 		//user isn't logged in, tried to login, validation succeeded but login failed
158 158
 		$this->request->setCallable(
159
-			function ($CI) {
159
+			function($CI) {
160 160
 				// Get mock object
161 161
 				$validation = $this->getDouble(
162 162
 					'CI_Form_validation',
Please login to merge, or discard this patch.
application/tests/controllers/User/Auth/Signup_test.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 		$this->assertResponseCode(200);
7 7
 
8 8
 		$this->request->setCallable(
9
-			function ($CI) {
9
+			function($CI) {
10 10
 				$auth = $this->getDouble('Auth_Model', ['verification_check' => 'foobar']);
11 11
 				$this->verifyInvokedOnce($auth, 'verification_check');
12 12
 				$CI->Auth = $auth;
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	public function test_index_logged_in() {
20 20
 		//user is already logged in, redirect to dashboard
21 21
 		$this->request->setCallablePreConstructor(
22
-			function () {
22
+			function() {
23 23
 				$ion_auth = $this->getMock_ion_auth_logged_in();
24 24
 				load_class_instance('ion_auth', $ion_auth);
25 25
 			}
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 	public function test_signup_p1_validation_pass_verification_pass() {
39 39
 		$this->request->setCallable(
40
-			function ($CI) {
40
+			function($CI) {
41 41
 				$validation = $this->getDouble(
42 42
 					'CI_Form_validation',
43 43
 					['set_rules' => NULL, 'run' => TRUE]
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 			}
52 52
 		);
53 53
 		$this->request->addCallable(
54
-				function ($CI) {
54
+				function($CI) {
55 55
 					$auth = $this->getDouble('Auth_Model', ['verification_start' => TRUE]);
56 56
 					$this->verifyInvokedOnce($auth, 'verification_start');
57 57
 					$CI->Auth = $auth;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	}
66 66
 	public function test_signup_p1_validation_pass_verification_fail() {
67 67
 		$this->request->setCallable(
68
-				function ($CI) {
68
+				function($CI) {
69 69
 					$validation = $this->getDouble(
70 70
 							'CI_Form_validation',
71 71
 							['set_rules' => NULL, 'run' => TRUE]
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				}
80 80
 		);
81 81
 		$this->request->addCallable(
82
-				function ($CI) {
82
+				function($CI) {
83 83
 					$auth = $this->getDouble('Auth_Model', ['verification_start' => FALSE]);
84 84
 					$this->verifyInvokedOnce($auth, 'verification_start');
85 85
 					$CI->Auth = $auth;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 	public function test_signup_p1_validation_fail() {
95 95
 		$this->request->setCallable(
96
-			function ($CI) {
96
+			function($CI) {
97 97
 				$validation = $this->getDouble(
98 98
 					'CI_Form_validation',
99 99
 					['set_rules' => NULL, 'run' => FALSE, 'set_value' => '']
@@ -115,14 +115,14 @@  discard block
 block discarded – undo
115 115
 		//form was valid, and register was successful, user is redirected to dashboard
116 116
 
117 117
 		$this->request->setCallable(
118
-			function ($CI) {
118
+			function($CI) {
119 119
 				$auth = $this->getDouble('Auth_Model', ['verification_check' => '[email protected]']);
120 120
 				$this->verifyInvokedOnce($auth, 'verification_check');
121 121
 				$CI->Auth = $auth;
122 122
 			}
123 123
 		);
124 124
 		$this->request->addCallable(
125
-			function ($CI) {
125
+			function($CI) {
126 126
 				$validation = $this->getDouble(
127 127
 					'CI_Form_validation',
128 128
 					['set_rules' => NULL, 'run' => TRUE]
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 			}
137 137
 		);
138 138
 		$this->request->addCallable(
139
-			function ($CI) {
139
+			function($CI) {
140 140
 				$auth = $this->getDouble(
141 141
 					'Ion_auth_model',
142 142
 					['register' => TRUE]
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 	public function test_signup_p2_verification_pass_validation_pass_register_fail() {
155 155
 		//form was valid, and register was unsuccessful, reshow form
156 156
 		$this->request->setCallable(
157
-			function ($CI) {
157
+			function($CI) {
158 158
 				$auth = $this->getDouble('Auth_Model', ['verification_check' => '[email protected]']);
159 159
 				$this->verifyInvokedOnce($auth, 'verification_check');
160 160
 				$CI->Auth = $auth;
161 161
 			}
162 162
 		);
163 163
 		$this->request->addCallable(
164
-			function ($CI) {
164
+			function($CI) {
165 165
 				$validation = $this->getDouble(
166 166
 					'CI_Form_validation',
167 167
 					['set_rules' => NULL, 'run' => TRUE, 'set_value' => 'foobar']
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 			}
177 177
 		);
178 178
 		$this->request->addCallable(
179
-			function ($CI) {
179
+			function($CI) {
180 180
 				$auth = $this->getDouble(
181 181
 					'Ion_auth_model',
182 182
 					['register' => FALSE, 'errors' => FALSE, 'logged_in' => FALSE]
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 	public function test_signup_p2_verification_pass_validation_fail() {
195 195
 		//validation failed, this is probably the first time the user visits the page, show form
196 196
 		$this->request->setCallable(
197
-			function ($CI) {
197
+			function($CI) {
198 198
 				$auth = $this->getDouble('Auth_Model', ['verification_check' => '[email protected]']);
199 199
 				$this->verifyInvokedOnce($auth, 'verification_check');
200 200
 				$CI->Auth = $auth;
201 201
 			}
202 202
 		);
203 203
 		$this->request->addCallable(
204
-			function ($CI) {
204
+			function($CI) {
205 205
 				$validation = $this->getDouble(
206 206
 					'CI_Form_validation',
207 207
 					['set_rules' => NULL, 'run' => FALSE, 'set_value' => '']
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	public function test_signup_p2_verification_fail() {
223 223
 		//validation failed, this is probably the first time the user visits the page, show form
224 224
 		$this->request->setCallable(
225
-			function ($CI) {
225
+			function($CI) {
226 226
 				$auth = $this->getDouble('Auth_Model', ['verification_check' => FALSE]);
227 227
 				$this->verifyInvokedOnce($auth, 'verification_check');
228 228
 				$CI->Auth = $auth;
Please login to merge, or discard this patch.
application/tests/controllers/User/Auth/Forgot_Password_test.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 
21 21
 		$this->request->setCallablePreConstructor(
22
-			function () {
22
+			function() {
23 23
 				$ion_auth = $this->getMock_ion_auth_logged_in();
24 24
 				load_class_instance('ion_auth', $ion_auth);
25 25
 			}
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	public function test_forgot_password_validation_pass() {
39 39
 		//user isn't logged in, form is valid, user is shown success page regardless of if email is used
40 40
 		$this->request->setCallable(
41
-			function ($CI) {
41
+			function($CI) {
42 42
 				$validation = $this->getDouble(
43 43
 					'CI_Form_validation',
44 44
 					['set_rules' => NULL, 'run' => TRUE]
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			}
53 53
 		);
54 54
 		$this->request->addCallable(
55
-			function ($CI) {
55
+			function($CI) {
56 56
 				$auth = $this->getDouble(
57 57
 					'Ion_auth_model',
58 58
 					['forgotten_password' => TRUE, 'row' => (object) ['email' => '[email protected]'], 'logged_in' => FALSE]
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	public function test_forgot_password_validation_fail() {
73 73
 		//user isn't logged in, form is invalid, this is usually the case when first viewing the page
74 74
 		$this->request->setCallable(
75
-			function ($CI) {
75
+			function($CI) {
76 76
 				$validation = $this->getDouble(
77 77
 					'CI_Form_validation',
78 78
 					['set_rules' => NULL, 'run' => FALSE]
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	public function test_reset_password_user_pass_validation_pass_change_fail() {
94 94
 		//reset code is valid, form is invalid (or new)
95 95
 		$this->request->addCallable(
96
-			function ($CI) {
96
+			function($CI) {
97 97
 				$auth = $this->getDouble(
98 98
 					'Ion_auth_model',
99 99
 					['forgotten_password_check' => TRUE, 'reset_password' => FALSE]
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			}
106 106
 		);
107 107
 		$this->request->addCallable(
108
-			function ($CI) {
108
+			function($CI) {
109 109
 				$validation = $this->getDouble(
110 110
 					'CI_Form_validation',
111 111
 					['set_rules' => NULL, 'run' => TRUE]
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	public function test_reset_password_user_pass_validation_pass_change_pass() {
127 127
 		//reset code is valid, form is valid, password change was successful, redirect to login
128 128
 		$this->request->addCallable(
129
-			function ($CI) {
129
+			function($CI) {
130 130
 				$auth = $this->getDouble(
131 131
 					'Ion_auth_model',
132 132
 					['forgotten_password_check' => TRUE, 'reset_password' => TRUE]
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			}
139 139
 		);
140 140
 		$this->request->addCallable(
141
-			function ($CI) {
141
+			function($CI) {
142 142
 				$validation = $this->getDouble(
143 143
 					'CI_Form_validation',
144 144
 					['set_rules' => NULL, 'run' => TRUE]
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	public function test_reset_password_user_pass_validation_fail() {
160 160
 		//reset code is valid, form is valid, password change was unsuccessful, send back to reset_password page
161 161
 		$this->request->setCallable(
162
-			function ($CI) {
162
+			function($CI) {
163 163
 				$auth = $this->getDouble(
164 164
 					'Ion_auth_model',
165 165
 					['forgotten_password_check' => TRUE, 'logged_in' => FALSE]
Please login to merge, or discard this patch.
application/tests/controllers/IndexC_test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 	public function test_APPPATH() {
15 15
 		$actual   = realpath(APPPATH);
16
-		$expected = realpath(__DIR__ . '/../..');
16
+		$expected = realpath(__DIR__.'/../..');
17 17
 		$this->assertEquals(
18 18
 			$expected,
19 19
 			$actual,
Please login to merge, or discard this patch.
application/tests/TestCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 		                  ->disableOriginalConstructor()
52 52
 		                  ->getMock();
53 53
 
54
-		foreach ($methods as $method => $return) {
54
+		foreach($methods as $method => $return) {
55 55
 			$db_result->method($method)->willReturn($return);
56 56
 		}
57 57
 		return $db_result;
Please login to merge, or discard this patch.
application/tests/Bootstrap.php 2 patches
Spacing   +13 added lines, -13 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 is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
57
+if(!defined('ENVIRONMENT'))
58 58
 {
59 59
 	define('ENVIRONMENT', 'testing');
60 60
 }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
  * Different environments will require different levels of error reporting.
68 68
  * By default development will show errors but testing and live will hide them.
69 69
  */
70
-switch (ENVIRONMENT)
70
+switch(ENVIRONMENT)
71 71
 {
72 72
 	case 'testing':
73 73
 	case 'development':
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 	case 'production':
79 79
 		ini_set('display_errors', 0);
80
-		if (version_compare(PHP_VERSION, '5.3', '>='))
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 83
 		}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		chdir(dirname(__FILE__));
201 201
 //	}
202 202
 
203
-	if (($_temp = realpath($system_path)) !== FALSE)
203
+	if(($_temp = realpath($system_path)) !== FALSE)
204 204
 	{
205 205
 		$system_path = $_temp.'/';
206 206
 	}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	}
212 212
 
213 213
 	// Is the system path correct?
214
-	if ( ! is_dir($system_path))
214
+	if(!is_dir($system_path))
215 215
 	{
216 216
 		header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
217 217
 		echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 	define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
237 237
 
238 238
 	// The path to the "application" folder
239
-	if (is_dir($application_folder))
239
+	if(is_dir($application_folder))
240 240
 	{
241
-		if (($_temp = realpath($application_folder)) !== FALSE)
241
+		if(($_temp = realpath($application_folder)) !== FALSE)
242 242
 		{
243 243
 			$application_folder = $_temp;
244 244
 		}
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	}
248 248
 	else
249 249
 	{
250
-		if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
250
+		if(!is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
251 251
 		{
252 252
 			header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
253 253
 			echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 	}
259 259
 
260 260
 	// The path to the "views" folder
261
-	if ( ! is_dir($view_folder))
261
+	if(!is_dir($view_folder))
262 262
 	{
263
-		if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
263
+		if(!empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
264 264
 		{
265 265
 			$view_folder = APPPATH.$view_folder;
266 266
 		}
267
-		elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
267
+		elseif(!is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
268 268
 		{
269 269
 			header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
270 270
 			echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		}
277 277
 	}
278 278
 
279
-	if (($_temp = realpath($view_folder)) !== FALSE)
279
+	if(($_temp = realpath($view_folder)) !== FALSE)
280 280
 	{
281 281
 		$view_folder = $_temp.DIRECTORY_SEPARATOR;
282 282
 	}
@@ -327,5 +327,5 @@  discard block
 block discarded – undo
327 327
  *  Added for CI PHPUnit Test
328 328
  * -------------------------------------------------------------------
329 329
  */
330
-require __DIR__ . '/_ci_phpunit_test/CIPHPUnitTest.php';
330
+require __DIR__.'/_ci_phpunit_test/CIPHPUnitTest.php';
331 331
 CIPHPUnitTest::init();
Please login to merge, or discard this patch.
Braces   +17 added lines, -40 removed lines patch added patch discarded remove patch
@@ -54,8 +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 is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
58
-{
57
+if (! defined('ENVIRONMENT')) {
59 58
 	define('ENVIRONMENT', 'testing');
60 59
 }
61 60
 
@@ -67,8 +66,7 @@  discard block
 block discarded – undo
67 66
  * Different environments will require different levels of error reporting.
68 67
  * By default development will show errors but testing and live will hide them.
69 68
  */
70
-switch (ENVIRONMENT)
71
-{
69
+switch (ENVIRONMENT) {
72 70
 	case 'testing':
73 71
 	case 'development':
74 72
 		error_reporting(-1);
@@ -77,12 +75,9 @@  discard block
 block discarded – undo
77 75
 
78 76
 	case 'production':
79 77
 		ini_set('display_errors', 0);
80
-		if (version_compare(PHP_VERSION, '5.3', '>='))
81
-		{
78
+		if (version_compare(PHP_VERSION, '5.3', '>=')) {
82 79
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
83
-		}
84
-		else
85
-		{
80
+		} else {
86 81
 			error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
87 82
 		}
88 83
 	break;
@@ -200,19 +195,15 @@  discard block
 block discarded – undo
200 195
 		chdir(dirname(__FILE__));
201 196
 //	}
202 197
 
203
-	if (($_temp = realpath($system_path)) !== FALSE)
204
-	{
198
+	if (($_temp = realpath($system_path)) !== FALSE) {
205 199
 		$system_path = $_temp.'/';
206
-	}
207
-	else
208
-	{
200
+	} else {
209 201
 		// Ensure there's a trailing slash
210 202
 		$system_path = rtrim($system_path, '/').'/';
211 203
 	}
212 204
 
213 205
 	// Is the system path correct?
214
-	if ( ! is_dir($system_path))
215
-	{
206
+	if ( ! is_dir($system_path)) {
216 207
 		header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
217 208
 		echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
218 209
 		exit(3); // EXIT_CONFIG
@@ -236,19 +227,14 @@  discard block
 block discarded – undo
236 227
 	define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
237 228
 
238 229
 	// The path to the "application" folder
239
-	if (is_dir($application_folder))
240
-	{
241
-		if (($_temp = realpath($application_folder)) !== FALSE)
242
-		{
230
+	if (is_dir($application_folder)) {
231
+		if (($_temp = realpath($application_folder)) !== FALSE) {
243 232
 			$application_folder = $_temp;
244 233
 		}
245 234
 
246 235
 		define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
247
-	}
248
-	else
249
-	{
250
-		if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
251
-		{
236
+	} else {
237
+		if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) {
252 238
 			header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
253 239
 			echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
254 240
 			exit(3); // EXIT_CONFIG
@@ -258,30 +244,21 @@  discard block
 block discarded – undo
258 244
 	}
259 245
 
260 246
 	// The path to the "views" folder
261
-	if ( ! is_dir($view_folder))
262
-	{
263
-		if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
264
-		{
247
+	if ( ! is_dir($view_folder)) {
248
+		if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) {
265 249
 			$view_folder = APPPATH.$view_folder;
266
-		}
267
-		elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
268
-		{
250
+		} elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) {
269 251
 			header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
270 252
 			echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
271 253
 			exit(3); // EXIT_CONFIG
272
-		}
273
-		else
274
-		{
254
+		} else {
275 255
 			$view_folder = APPPATH.'views';
276 256
 		}
277 257
 	}
278 258
 
279
-	if (($_temp = realpath($view_folder)) !== FALSE)
280
-	{
259
+	if (($_temp = realpath($view_folder)) !== FALSE) {
281 260
 		$view_folder = $_temp.DIRECTORY_SEPARATOR;
282
-	}
283
-	else
284
-	{
261
+	} else {
285 262
 		$view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
286 263
 	}
287 264
 
Please login to merge, or discard this patch.
application/tests/mocks/autoloader.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,49 +60,49 @@  discard block
 block discarded – undo
60 60
 
61 61
 	$ci_drivers = array('Session', 'Cache');
62 62
 
63
-	if (strpos($class, 'Mock_') === 0)
63
+	if(strpos($class, 'Mock_') === 0)
64 64
 	{
65 65
 		$class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class));
66 66
 	}
67
-	elseif (strpos($class, 'CI_') === 0)
67
+	elseif(strpos($class, 'CI_') === 0)
68 68
 	{
69 69
 		$subclass = substr($class, 3);
70 70
 
71
-		if (in_array($subclass, $ci_core))
71
+		if(in_array($subclass, $ci_core))
72 72
 		{
73 73
 			$dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR;
74 74
 			$class = $subclass;
75 75
 		}
76
-		elseif (in_array($subclass, $ci_libraries))
76
+		elseif(in_array($subclass, $ci_libraries))
77 77
 		{
78 78
 			$dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR;
79 79
 			$class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass;
80 80
 		}
81
-		elseif (in_array($subclass, $ci_drivers))
81
+		elseif(in_array($subclass, $ci_drivers))
82 82
 		{
83 83
 			$dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR;
84 84
 			$class = $subclass;
85 85
 		}
86
-		elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) {
86
+		elseif(in_array(($parent = strtok($subclass, '_')), $ci_drivers)) {
87 87
 			$dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
88 88
 			$class = $subclass;
89 89
 		}
90
-		elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4)
90
+		elseif(preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4)
91 91
 		{
92 92
 			$driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
93 93
 			$dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR;
94 94
 			$file = $dir.$m[1].'_'.$m[2].'_'.$m[3].'.php';
95 95
 		}
96
-		elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3)
96
+		elseif(preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3)
97 97
 		{
98 98
 			$driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
99 99
 			$dir = $driver_path.$m[1].DIRECTORY_SEPARATOR;
100 100
 			$file = $dir.$m[1].'_'.$m[2].'.php';
101 101
 		}
102
-		elseif (strpos($class, 'CI_DB') === 0)
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
 		{
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 	$file = isset($file) ? $file : $dir.$class.'.php';
114 114
 
115
-	if ( ! file_exists($file))
115
+	if(!file_exists($file))
116 116
 	{
117 117
 		return FALSE;
118 118
 	}
Please login to merge, or discard this patch.
Braces   +12 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
 // $mock_table = new Mock_Libraries_Table(); 			// Will load ./mocks/libraries/table.php
12 12
 // $mock_database_driver = new Mock_Database_Driver();	// Will load ./mocks/database/driver.php
13 13
 // and so on...
14
-function autoload($class)
15
-{
14
+function autoload($class) {
16 15
 	$dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
17 16
 
18 17
 	$ci_core = array(
@@ -60,60 +59,42 @@  discard block
 block discarded – undo
60 59
 
61 60
 	$ci_drivers = array('Session', 'Cache');
62 61
 
63
-	if (strpos($class, 'Mock_') === 0)
64
-	{
62
+	if (strpos($class, 'Mock_') === 0) {
65 63
 		$class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class));
66
-	}
67
-	elseif (strpos($class, 'CI_') === 0)
68
-	{
64
+	} elseif (strpos($class, 'CI_') === 0) {
69 65
 		$subclass = substr($class, 3);
70 66
 
71
-		if (in_array($subclass, $ci_core))
72
-		{
67
+		if (in_array($subclass, $ci_core)) {
73 68
 			$dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR;
74 69
 			$class = $subclass;
75
-		}
76
-		elseif (in_array($subclass, $ci_libraries))
77
-		{
70
+		} elseif (in_array($subclass, $ci_libraries)) {
78 71
 			$dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR;
79 72
 			$class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass;
80
-		}
81
-		elseif (in_array($subclass, $ci_drivers))
82
-		{
73
+		} elseif (in_array($subclass, $ci_drivers)) {
83 74
 			$dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR;
84 75
 			$class = $subclass;
85
-		}
86
-		elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) {
76
+		} elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) {
87 77
 			$dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
88 78
 			$class = $subclass;
89
-		}
90
-		elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4)
91
-		{
79
+		} elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) {
92 80
 			$driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
93 81
 			$dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR;
94 82
 			$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)
97
-		{
83
+		} elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) {
98 84
 			$driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
99 85
 			$dir = $driver_path.$m[1].DIRECTORY_SEPARATOR;
100 86
 			$file = $dir.$m[1].'_'.$m[2].'.php';
101
-		}
102
-		elseif (strpos($class, 'CI_DB') === 0)
103
-		{
87
+		} elseif (strpos($class, 'CI_DB') === 0) {
104 88
 			$dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR;
105 89
 			$file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php';
106
-		}
107
-		else
108
-		{
90
+		} else {
109 91
 			$class = strtolower($class);
110 92
 		}
111 93
 	}
112 94
 
113 95
 	$file = isset($file) ? $file : $dir.$class.'.php';
114 96
 
115
-	if ( ! file_exists($file))
116
-	{
97
+	if ( ! file_exists($file)) {
117 98
 		return FALSE;
118 99
 	}
119 100
 
Please login to merge, or discard this patch.
application/tests/mocks/libraries/email.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
  * @link       https://github.com/kenjis/ci-phpunit-test
9 9
  */
10 10
 
11
-class Mock_Libraries_Email
12
-{
11
+class Mock_Libraries_Email {
13 12
 	private $data = [];
14 13
 
15 14
 	/**
@@ -17,43 +16,35 @@  discard block
 block discarded – undo
17 16
 	 */
18 17
 	public $return_send = TRUE;
19 18
 
20
-	public function initialize()
21
-	{
19
+	public function initialize() {
22 20
 		
23 21
 	}
24 22
 
25
-	public function from($from)
26
-	{
23
+	public function from($from) {
27 24
 		$this->data['from'] = $from;
28 25
 	}
29 26
 
30
-	public function to($to)
31
-	{
27
+	public function to($to) {
32 28
 		$this->data['to'] = $to;
33 29
 	}
34 30
 
35
-	public function bcc($bcc)
36
-	{
31
+	public function bcc($bcc) {
37 32
 		$this->data['bcc'] = $bcc;
38 33
 	}
39 34
 
40
-	public function subject($subject)
41
-	{
35
+	public function subject($subject) {
42 36
 		$this->data['subject'] = $subject;
43 37
 	}
44 38
 
45
-	public function message($message)
46
-	{
39
+	public function message($message) {
47 40
 		$this->data['message'] = $message;
48 41
 	}
49 42
 
50
-	public function send()
51
-	{
43
+	public function send() {
52 44
 		return $this->return_send;
53 45
 	}
54 46
 
55
-	public function _get_data()
56
-	{
47
+	public function _get_data() {
57 48
 		return $this->data;
58 49
 	}
59 50
 }
Please login to merge, or discard this patch.