| @@ -63,8 +63,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | 
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 |  <?php defined('BASEPATH') OR exit('No direct script access allowed'); | 
| 2 | 2 | |
| 3 | -class About extends MY_Controller | |
| 4 | -{ | |
| 3 | +class About extends MY_Controller { | |
| 5 | 4 |  	public function __construct() { | 
| 6 | 5 | parent::__construct(); | 
| 7 | 6 | } | 
| @@ -89,12 +89,14 @@ | ||
| 89 | 89 | //password changed successfully, redirect to login | 
| 90 | 90 |  					$this->session->set_flashdata('notices', $this->ion_auth->messages()); | 
| 91 | 91 |  					redirect("user/login", 'refresh'); | 
| 92 | -				} else { //@codeCoverageIgnore | |
| 92 | +				} else { | |
| 93 | +//@codeCoverageIgnore | |
| 93 | 94 | //password changed unsuccessfully, refresh page. | 
| 94 | 95 |  					$this->session->set_flashdata('notices', $this->ion_auth->errors()); | 
| 95 | 96 |  					redirect('user/reset_password/'.$code, 'refresh'); | 
| 96 | 97 | } | 
| 97 | -			} else { //@codeCoverageIgnore | |
| 98 | +			} else { | |
| 99 | +//@codeCoverageIgnore | |
| 98 | 100 | //form is invalid OR first-time viewing page | 
| 99 | 101 |  				$this->global_data['notices'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('notices'); | 
| 100 | 102 | |
| @@ -46,7 +46,8 @@ | ||
| 46 | 46 |  				$this->session->keep_flashdata('referred_from'); | 
| 47 | 47 |  				if($prevURL = $this->session->flashdata('referred_from')) { | 
| 48 | 48 | redirect($prevURL); | 
| 49 | -				} else { //@codeCoverageIgnore | |
| 49 | +				} else { | |
| 50 | +//@codeCoverageIgnore | |
| 50 | 51 |  					redirect('/'); //TODO (CHECK): Should this be refresh? | 
| 51 | 52 | } //@codeCoverageIgnore | 
| 52 | 53 |  			} else { | 
| @@ -54,7 +54,7 @@ discard block | ||
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 | //login wasn't valid, failed, or this is a fresh login attempt | 
| 57 | -		if(!$isValid){ | |
| 57 | +		if(!$isValid) { | |
| 58 | 58 | //display the email validation form | 
| 59 | 59 | |
| 60 | 60 |  			$this->global_data['notices'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'))); | 
| @@ -89,7 +89,9 @@ discard block | ||
| 89 | 89 | //This continued signup occurs after the user clicks the verification link in their email. | 
| 90 | 90 |  	private function _continue_signup($verificationCode) { | 
| 91 | 91 | //check if validation is valid, if so return email, if not redirect to signup | 
| 92 | -		if(!($email = $this->Auth->verification_check($verificationCode))) redirect('user/signup'); | |
| 92 | +		if(!($email = $this->Auth->verification_check($verificationCode))) { | |
| 93 | +			redirect('user/signup'); | |
| 94 | + } | |
| 93 | 95 | |
| 94 | 96 | //validation is valid, proceed as normal | 
| 95 | 97 |  		$this->form_validation->set_rules('username',         'Username',           'required|min_length[4]|max_length[15]|valid_username|is_unique_username'); | 
| @@ -113,7 +115,8 @@ discard block | ||
| 113 | 115 | $this->Auth->verification_complete($email); | 
| 114 | 116 | |
| 115 | 117 |  				redirect('help'); | 
| 116 | -			} else { //@codeCoverageIgnore | |
| 118 | +			} else { | |
| 119 | +//@codeCoverageIgnore | |
| 117 | 120 | //Signup failed. | 
| 118 | 121 | |
| 119 | 122 |  				$this->session->set_flashdata('notices', $this->ion_auth->errors()); | 
| @@ -123,7 +126,7 @@ discard block | ||
| 123 | 126 | } | 
| 124 | 127 | |
| 125 | 128 | //signup wasn't valid, failed, or this is a fresh signup attempt | 
| 126 | -		if(!$isValid){ | |
| 129 | +		if(!$isValid) { | |
| 127 | 130 | //display the create user form | 
| 128 | 131 | |
| 129 | 132 |  			$this->global_data['notices'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'))); | 
| @@ -71,7 +71,7 @@ | ||
| 71 | 71 |  			if($query->num_rows() > 0) { | 
| 72 | 72 | //username exists, grab email | 
| 73 | 73 |  				$email = $query->row('email'); | 
| 74 | -			}else{ | |
| 74 | +			} else { | |
| 75 | 75 | //username doesn't exist, return FALSE | 
| 76 | 76 | $email = FALSE; | 
| 77 | 77 | } | 
| @@ -16,8 +16,7 @@ | ||
| 16 | 16 | * | 
| 17 | 17 | * @SuppressWarnings(PHPMD) | 
| 18 | 18 | */ | 
| 19 | -class UnitTester extends \Codeception\Actor | |
| 20 | -{ | |
| 19 | +class UnitTester extends \Codeception\Actor { | |
| 21 | 20 | use _generated\UnitTesterActions; | 
| 22 | 21 | |
| 23 | 22 | /** | 
| @@ -4,7 +4,6 @@ | ||
| 4 | 4 | // here you can define custom actions | 
| 5 | 5 | // all public methods declared in helper class will be available in $I | 
| 6 | 6 | |
| 7 | -class Functional extends \Codeception\Module | |
| 8 | -{ | |
| 7 | +class Functional extends \Codeception\Module { | |
| 9 | 8 | |
| 10 | 9 | } | 
| @@ -4,7 +4,6 @@ | ||
| 4 | 4 | // here you can define custom actions | 
| 5 | 5 | // all public methods declared in helper class will be available in $I | 
| 6 | 6 | |
| 7 | -class Unit extends \Codeception\Module | |
| 8 | -{ | |
| 7 | +class Unit extends \Codeception\Module { | |
| 9 | 8 | |
| 10 | 9 | } |