Completed
Branch FET-7988-evertec-needs (20e248)
by
unknown
114:06 queued 104:38
created
modules/single_page_checkout/EED_Single_Page_Checkout.module.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Single Page Checkout (SPCO)
4 6
  *
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 *    process_registration_from_admin
281 281
 	 *
282 282
 	 * @access    public
283
-	 * @return    int
283
+	 * @return    EE_Transaction
284 284
 	 */
285 285
 	public static function process_registration_from_admin() {
286 286
 		EED_Single_Page_Checkout::load_reg_steps();
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 * _get_transaction_and_cart_for_previous_visit
609 609
 	 *
610 610
 	 * @access private
611
-	 * 	@return mixed EE_Transaction|NULL
611
+	 * 	@return EE_Transaction|null EE_Transaction|NULL
612 612
 	 */
613 613
 	private function _get_transaction_and_cart_for_previous_visit() {
614 614
 		/** @var $TXN_model EEM_Transaction */
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	 * 	generates a new EE_Transaction object and adds it to the $_transaction property.
678 678
 	 *
679 679
 	 * 	@access private
680
-	 * 	@return mixed EE_Transaction|NULL
680
+	 * 	@return EE_Transaction|null EE_Transaction|NULL
681 681
 	 */
682 682
 	private function _initialize_transaction() {
683 683
 		try {
Please login to merge, or discard this patch.
Spacing   +268 added lines, -268 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @return EED_Single_Page_Checkout
39 39
 	 */
40 40
 	public static function instance() {
41
-		return parent::get_instance( __CLASS__ );
41
+		return parent::get_instance(__CLASS__);
42 42
 	}
43 43
 
44 44
 
@@ -83,20 +83,20 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public static function set_hooks_admin() {
85 85
 		EED_Single_Page_Checkout::set_definitions();
86
-		if ( defined( 'DOING_AJAX' )) {
86
+		if (defined('DOING_AJAX')) {
87 87
 			EED_Single_Page_Checkout::load_request_handler();
88 88
 			EED_Single_Page_Checkout::load_reg_steps();
89 89
 		} else {
90 90
 			// hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called
91
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 );
91
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1);
92 92
 		}
93 93
 		// set ajax hooks
94
-		add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
95
-		add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
96
-		add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
97
-		add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
98
-		add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
99
-		add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
94
+		add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
95
+		add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
96
+		add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
97
+		add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
98
+		add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
99
+		add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
100 100
 	}
101 101
 
102 102
 
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 * 	process ajax request
106 106
 	 * @param string $ajax_action
107 107
 	 */
108
-	public static function process_ajax_request( $ajax_action ) {
109
-		EE_Registry::instance()->REQ->set( 'action', $ajax_action );
108
+	public static function process_ajax_request($ajax_action) {
109
+		EE_Registry::instance()->REQ->set('action', $ajax_action);
110 110
 		EED_Single_Page_Checkout::instance()->_initialize();
111 111
 	}
112 112
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * 	ajax display registration step
117 117
 	 */
118 118
 	public static function display_reg_step() {
119
-		EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' );
119
+		EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step');
120 120
 	}
121 121
 
122 122
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * 	ajax process registration step
126 126
 	 */
127 127
 	public static function process_reg_step() {
128
-		EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' );
128
+		EED_Single_Page_Checkout::process_ajax_request('process_reg_step');
129 129
 	}
130 130
 
131 131
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 * 	ajax process registration step
135 135
 	 */
136 136
 	public static function update_reg_step() {
137
-		EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' );
137
+		EED_Single_Page_Checkout::process_ajax_request('update_reg_step');
138 138
 	}
139 139
 
140 140
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public static function load_request_handler() {
149 149
 		// load core Request_Handler class
150
-		if ( ! isset( EE_Registry::instance()->REQ )) {
151
-			EE_Registry::instance()->load_core( 'Request_Handler' );
150
+		if ( ! isset(EE_Registry::instance()->REQ)) {
151
+			EE_Registry::instance()->load_core('Request_Handler');
152 152
 		}
153 153
 	}
154 154
 
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
 	 *  @return 	void
162 162
 	 */
163 163
 	public static function set_definitions() {
164
-		define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS );
165
-		define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS );
166
-		define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS );
167
-		define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS );
168
-		define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS );
169
-		define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS );
170
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE );
164
+		define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS);
165
+		define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS);
166
+		define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS);
167
+		define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS);
168
+		define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS);
169
+		define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS);
170
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE);
171 171
 	}
172 172
 
173 173
 
@@ -182,31 +182,31 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	public static function load_reg_steps() {
184 184
 		static $reg_steps_loaded = FALSE;
185
-		if ( $reg_steps_loaded ) {
185
+		if ($reg_steps_loaded) {
186 186
 			return;
187 187
 		}
188 188
 		// load EE_SPCO_Reg_Step base class
189
-		EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_SPCO_Reg_Step', 'class'  );
189
+		EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_SPCO_Reg_Step', 'class');
190 190
 		// filter list of reg_steps
191
-		$reg_steps_to_load = apply_filters( 'AHEE__SPCO__load_reg_steps__reg_steps_to_load', EED_Single_Page_Checkout::get_reg_steps() );
191
+		$reg_steps_to_load = apply_filters('AHEE__SPCO__load_reg_steps__reg_steps_to_load', EED_Single_Page_Checkout::get_reg_steps());
192 192
 		// sort by key (order)
193
-		ksort( $reg_steps_to_load );
193
+		ksort($reg_steps_to_load);
194 194
 		// loop through folders
195
-		foreach ( $reg_steps_to_load as $order => $reg_step ) {
195
+		foreach ($reg_steps_to_load as $order => $reg_step) {
196 196
 			// we need a
197
-			if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
197
+			if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
198 198
 				// copy over to the reg_steps_array
199
-				EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step;
199
+				EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step;
200 200
 				// register custom key route for each reg step ( ie: step=>"slug" - this is the entire reason we load the reg steps array now )
201
-				EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' );
201
+				EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step');
202 202
 				// add AJAX or other hooks
203
-				if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) {
203
+				if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) {
204 204
 					// setup autoloaders if necessary
205
-					if ( ! class_exists( $reg_step['class_name'] )) {
206
-						EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE );
205
+					if ( ! class_exists($reg_step['class_name'])) {
206
+						EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE);
207 207
 					}
208
-					if ( is_callable( $reg_step['class_name'], 'set_hooks' )) {
209
-						call_user_func( array( $reg_step['class_name'], 'set_hooks' ));
208
+					if (is_callable($reg_step['class_name'], 'set_hooks')) {
209
+						call_user_func(array($reg_step['class_name'], 'set_hooks'));
210 210
 					}
211 211
 				}
212 212
 			}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	public static function get_reg_steps() {
227 227
 		$reg_steps = EE_Registry::instance()->CFG->registration->reg_steps;
228
-		if ( empty( $reg_steps )) {
228
+		if (empty($reg_steps)) {
229 229
 			$reg_steps = array(
230 230
 				10 => array(
231 231
 					'file_path' => SPCO_INC_PATH,
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	public static function registration_checkout_for_admin() {
268 268
 		EED_Single_Page_Checkout::load_reg_steps();
269
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
270
-		EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' );
271
-		EE_Registry::instance()->REQ->set( 'process_form_submission', false );
269
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
270
+		EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step');
271
+		EE_Registry::instance()->REQ->set('process_form_submission', false);
272 272
 		EED_Single_Page_Checkout::instance()->_initialize();
273 273
 		EED_Single_Page_Checkout::instance()->_display_spco_reg_form();
274 274
 		return EE_Registry::instance()->REQ->get_output();
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	public static function process_registration_from_admin() {
286 286
 		EED_Single_Page_Checkout::load_reg_steps();
287
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
288
-		EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' );
289
-		EE_Registry::instance()->REQ->set( 'process_form_submission', true );
287
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
288
+		EE_Registry::instance()->REQ->set('action', 'process_reg_step');
289
+		EE_Registry::instance()->REQ->set('process_form_submission', true);
290 290
 		EED_Single_Page_Checkout::instance()->_initialize();
291
-		if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) {
292
-			$final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps );
293
-			if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
294
-				if ( $final_reg_step->process_reg_step() ) {
291
+		if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) {
292
+			$final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps);
293
+			if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
294
+				if ($final_reg_step->process_reg_step()) {
295 295
 					return EED_Single_Page_Checkout::instance()->checkout->transaction;
296 296
 				}
297 297
 			}
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 	 * @param WP_Query $WP_Query
309 309
 	 * @return    void
310 310
 	 */
311
-	public function run( $WP_Query ) {
312
-		if ( $WP_Query instanceof WP_Query && $WP_Query->is_main_query() ) {
311
+	public function run($WP_Query) {
312
+		if ($WP_Query instanceof WP_Query && $WP_Query->is_main_query()) {
313 313
 			$this->_initialize();
314 314
 		}
315 315
 	}
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 	 * @param WP_Query $WP_Query
325 325
 	 * @return    void
326 326
 	 */
327
-	public static function init( $WP_Query ) {
328
-		if ( $WP_Query instanceof WP_Query && $WP_Query->is_main_query() ) {
327
+	public static function init($WP_Query) {
328
+		if ($WP_Query instanceof WP_Query && $WP_Query->is_main_query()) {
329 329
 			EED_Single_Page_Checkout::instance()->_initialize();
330 330
 		}
331 331
 	}
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	 */
342 342
 	private function _initialize() {
343 343
 		// ensure SPCO doesn't run twice
344
-		if ( EED_Single_Page_Checkout::$_initialized ) {
344
+		if (EED_Single_Page_Checkout::$_initialized) {
345 345
 			return;
346 346
 		}
347 347
 		// setup the EE_Checkout object
@@ -349,22 +349,22 @@  discard block
 block discarded – undo
349 349
 		// get the $_GET
350 350
 		$this->_get_request_vars();
351 351
 		// filter continue_reg
352
-		$this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout );
352
+		$this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout);
353 353
 		// load the reg steps array
354
-		if ( ! $this->_load_and_instantiate_reg_steps() ) {
354
+		if ( ! $this->_load_and_instantiate_reg_steps()) {
355 355
 			EED_Single_Page_Checkout::$_initialized = true;
356 356
 			return;
357 357
 		}
358 358
 		// set the current step
359
-		$this->checkout->set_current_step( $this->checkout->step );
359
+		$this->checkout->set_current_step($this->checkout->step);
360 360
 		// and the next step
361 361
 		$this->checkout->set_next_step();
362 362
 		// was there already a valid transaction in the checkout from the session ?
363
-		if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
363
+		if ( ! $this->checkout->transaction instanceof EE_Transaction) {
364 364
 			// get transaction from db or session
365 365
 			$this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin() ? $this->_get_transaction_and_cart_for_previous_visit() : $this->_get_cart_for_current_session_and_setup_new_transaction();
366
-			if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
367
-				EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
366
+			if ( ! $this->checkout->transaction instanceof EE_Transaction) {
367
+				EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
368 368
 				// add some style and make it dance
369 369
 				$this->checkout->transaction = EE_Transaction::new_instance();
370 370
 				$this->add_styles_and_scripts();
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
 				return;
373 373
 			}
374 374
 			// and the registrations for the transaction
375
-			$this->_get_registrations( $this->checkout->transaction );
375
+			$this->_get_registrations($this->checkout->transaction);
376 376
 		}
377 377
 		// verify that everything has been setup correctly
378
-		if ( ! $this->_final_verifications() ) {
378
+		if ( ! $this->_final_verifications()) {
379 379
 			EED_Single_Page_Checkout::$_initialized = true;
380 380
 			return;
381 381
 		}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		// set no cache headers and constants
401 401
 		EE_System::do_not_cache();
402 402
 		// remove transaction lock
403
-		add_action( 'shutdown', array( $this, 'unlock_transaction' ), 1 );
403
+		add_action('shutdown', array($this, 'unlock_transaction'), 1);
404 404
 	}
405 405
 
406 406
 
@@ -417,16 +417,16 @@  discard block
 block discarded – undo
417 417
 		// look in session for existing checkout
418 418
 		$checkout = EE_Registry::instance()->SSN->checkout();
419 419
 		// verify
420
-		if ( ! $checkout instanceof EE_Checkout ) {
420
+		if ( ! $checkout instanceof EE_Checkout) {
421 421
 			// instantiate EE_Checkout object for handling the properties of the current checkout process
422
-			$checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE  );
422
+			$checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE);
423 423
 			// verify again
424
-			if ( ! $checkout instanceof EE_Checkout ) {
425
-				throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) );
424
+			if ( ! $checkout instanceof EE_Checkout) {
425
+				throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso'));
426 426
 			}
427 427
 		} else {
428
-			if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true )  {
429
-				wp_safe_redirect( $checkout->redirect_url );
428
+			if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) {
429
+				wp_safe_redirect($checkout->redirect_url);
430 430
 				exit();
431 431
 			}
432 432
 		}
@@ -447,22 +447,22 @@  discard block
 block discarded – undo
447 447
 		// load classes
448 448
 		EED_Single_Page_Checkout::load_request_handler();
449 449
 		//make sure this request is marked as belonging to EE
450
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
450
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
451 451
 		// which step is being requested ?
452
-		$this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() );
452
+		$this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step());
453 453
 		// which step is being edited ?
454
-		$this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' );
454
+		$this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', '');
455 455
 		// and what we're doing on the current step
456
-		$this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' );
456
+		$this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step');
457 457
 		// returning to edit ?
458
-		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' );
458
+		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', '');
459 459
 		// or some other kind of revisit ?
460
-		$this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE );
460
+		$this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE);
461 461
 		// and whether or not to generate a reg form for this request
462
-		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); 		// TRUE 	FALSE
462
+		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE 	FALSE
463 463
 		// and whether or not to process a reg form submission for this request
464
-		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); 		// TRUE 	FALSE
465
-		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' ? $this->checkout->process_form_submission : FALSE; 		// TRUE 	FALSE
464
+		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE 	FALSE
465
+		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' ? $this->checkout->process_form_submission : FALSE; // TRUE 	FALSE
466 466
 		//$this->_display_request_vars();
467 467
 	}
468 468
 
@@ -477,14 +477,14 @@  discard block
 block discarded – undo
477 477
 	 * @return    array
478 478
 	 */
479 479
 	protected function _display_request_vars() {
480
-		EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
481
-		EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ );
482
-		EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ );
483
-		EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ );
484
-		EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ );
485
-		EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ );
486
-		EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ );
487
-		EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ );
480
+		EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__);
481
+		EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__);
482
+		EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__);
483
+		EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__);
484
+		EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__);
485
+		EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__);
486
+		EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__);
487
+		EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__);
488 488
 	}
489 489
 
490 490
 
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
 	 * @return    array
499 499
 	 */
500 500
 	private function _get_first_step() {
501
-		$first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array );
502
-		return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information';
501
+		$first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array);
502
+		return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information';
503 503
 	}
504 504
 
505 505
 
@@ -514,35 +514,35 @@  discard block
 block discarded – undo
514 514
 	 */
515 515
 	private function _load_and_instantiate_reg_steps() {
516 516
 		// have reg_steps already been instantiated ?
517
-		if ( empty( $this->checkout->reg_steps )) {
517
+		if (empty($this->checkout->reg_steps)) {
518 518
 			// if not, then loop through raw reg steps array
519
-			foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) {
520
-				if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) {
519
+			foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) {
520
+				if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) {
521 521
 					return false;
522 522
 				}
523 523
 			}
524 524
 			EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE;
525 525
 			EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE;
526 526
 			// skip the registration_confirmation page ?
527
-			if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) {
527
+			if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) {
528 528
 				// just remove it from the reg steps array
529
-				$this->checkout->remove_reg_step( 'registration_confirmation' );
530
-			} else if ( EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset( 	$this->checkout->reg_steps['registration_confirmation'] )) {
529
+				$this->checkout->remove_reg_step('registration_confirmation');
530
+			} else if (EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset($this->checkout->reg_steps['registration_confirmation'])) {
531 531
 				// set the order to something big like 100
532
-				$this->checkout->set_reg_step_order( 'registration_confirmation', 100 );
532
+				$this->checkout->set_reg_step_order('registration_confirmation', 100);
533 533
 			}
534 534
 			// filter the array for good luck
535
-			$this->checkout->reg_steps = apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps );
535
+			$this->checkout->reg_steps = apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps);
536 536
 			// finally re-sort based on the reg step class order properties
537 537
 			$this->checkout->sort_reg_steps();
538 538
 		} else {
539
-			foreach ( $this->checkout->reg_steps as $reg_step ) {
539
+			foreach ($this->checkout->reg_steps as $reg_step) {
540 540
 				// set all current step stati to FALSE
541
-				$reg_step->set_is_current_step( FALSE );
541
+				$reg_step->set_is_current_step(FALSE);
542 542
 			}
543 543
 		}
544
-		if ( empty( $this->checkout->reg_steps )) {
545
-			EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
544
+		if (empty($this->checkout->reg_steps)) {
545
+			EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
546 546
 			return false;
547 547
 		}
548 548
 			// make reg step details available to JS
@@ -560,34 +560,34 @@  discard block
 block discarded – undo
560 560
 	 * @param int   $order
561 561
 	 * @return bool
562 562
 	 */
563
-	private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) {
563
+	private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) {
564 564
 
565 565
 		// we need a file_path, class_name, and slug to add a reg step
566
-		if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
566
+		if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
567 567
 			// if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step)
568
-			if ( $this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration' ) {
568
+			if ($this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration') {
569 569
 				return true;
570 570
 			}
571 571
 			// instantiate step class using file path and class name
572
-			$reg_step_obj = EE_Registry::instance()->load_file( $reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE  );
572
+			$reg_step_obj = EE_Registry::instance()->load_file($reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE);
573 573
 			// did we gets the goods ?
574
-			if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) {
574
+			if ($reg_step_obj instanceof EE_SPCO_Reg_Step) {
575 575
 				// set reg step order based on config
576
-				$reg_step_obj->set_order( $order );
576
+				$reg_step_obj->set_order($order);
577 577
 				// add instantiated reg step object to the master reg steps array
578
-				$this->checkout->add_reg_step( $reg_step_obj );
578
+				$this->checkout->add_reg_step($reg_step_obj);
579 579
 			} else {
580
-				EE_Error::add_error( __( 'The current step could not be set.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
580
+				EE_Error::add_error(__('The current step could not be set.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
581 581
 				return false;
582 582
 			}
583 583
 		} else {
584
-			if ( WP_DEBUG ) {
584
+			if (WP_DEBUG) {
585 585
 				EE_Error::add_error(
586 586
 					sprintf(
587
-						__( 'A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso' ),
588
-						isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '',
589
-						isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '',
590
-						isset( $reg_step['slug'] ) ? $reg_step['slug'] : '',
587
+						__('A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso'),
588
+						isset($reg_step['file_path']) ? $reg_step['file_path'] : '',
589
+						isset($reg_step['class_name']) ? $reg_step['class_name'] : '',
590
+						isset($reg_step['slug']) ? $reg_step['slug'] : '',
591 591
 						'<ul>',
592 592
 						'<li>',
593 593
 						'</li>',
@@ -611,16 +611,16 @@  discard block
 block discarded – undo
611 611
 	 */
612 612
 	private function _get_transaction_and_cart_for_previous_visit() {
613 613
 		/** @var $TXN_model EEM_Transaction */
614
-		$TXN_model = EE_Registry::instance()->load_model( 'Transaction' );
614
+		$TXN_model = EE_Registry::instance()->load_model('Transaction');
615 615
 		// because the reg_url_link is present in the request, this is a return visit to SPCO, so we'll get the transaction data from the db
616
-		$transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link );
616
+		$transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link);
617 617
 		// verify transaction
618
-		if ( $transaction instanceof EE_Transaction ) {
618
+		if ($transaction instanceof EE_Transaction) {
619 619
 			// and get the cart that was used for that transaction
620
-			$this->checkout->cart = $this->_get_cart_for_transaction( $transaction );
620
+			$this->checkout->cart = $this->_get_cart_for_transaction($transaction);
621 621
 			return $transaction;
622 622
 		} else {
623
-			EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
623
+			EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
624 624
 			return NULL;
625 625
 		}
626 626
 	}
@@ -634,11 +634,11 @@  discard block
 block discarded – undo
634 634
 	 * @param EE_Transaction $transaction
635 635
 	 * @return EE_Cart
636 636
 	 */
637
-	private function _get_cart_for_transaction( $transaction ) {
638
-		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction ) : NULL;
637
+	private function _get_cart_for_transaction($transaction) {
638
+		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction) : NULL;
639 639
 		// verify cart
640
-		if ( ! $cart instanceof EE_Cart ) {
641
-			$cart = EE_Registry::instance()->load_core( 'Cart' );
640
+		if ( ! $cart instanceof EE_Cart) {
641
+			$cart = EE_Registry::instance()->load_core('Cart');
642 642
 		}
643 643
 		return $cart;
644 644
 	}
@@ -655,17 +655,17 @@  discard block
 block discarded – undo
655 655
 	private function _get_cart_for_current_session_and_setup_new_transaction() {
656 656
 		//  if there's no transaction, then this is the FIRST visit to SPCO
657 657
 		// so load up the cart ( passing nothing for the TXN because it doesn't exist yet )
658
-		$this->checkout->cart = $this->_get_cart_for_transaction( NULL );
658
+		$this->checkout->cart = $this->_get_cart_for_transaction(NULL);
659 659
 		// and then create a new transaction
660 660
 		$transaction = $this->_initialize_transaction();
661 661
 		// verify transaction
662
-		if ( $transaction instanceof EE_Transaction ) {
662
+		if ($transaction instanceof EE_Transaction) {
663 663
 			// save it so that we have an ID for other objects to use
664 664
 			$transaction->save();
665 665
 			// and save TXN data to the cart
666
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() );
666
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID());
667 667
 		} else {
668
-			EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
668
+			EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
669 669
 		}
670 670
 		return $transaction;
671 671
 	}
@@ -681,15 +681,15 @@  discard block
 block discarded – undo
681 681
 	private function _initialize_transaction() {
682 682
 		try {
683 683
 			// create new TXN
684
-			return EE_Transaction::new_instance( array(
685
-				'TXN_timestamp' 	=> current_time( 'timestamp' ),
684
+			return EE_Transaction::new_instance(array(
685
+				'TXN_timestamp' 	=> current_time('timestamp'),
686 686
 				'TXN_reg_steps' 		=> $this->checkout->initialize_txn_reg_steps_array(),
687 687
 				'TXN_total' 				=> $this->checkout->cart->get_cart_grand_total(),
688 688
 				'TXN_paid' 				=> 0,
689 689
 				'STS_ID' 					=> EEM_Transaction::failed_status_code,
690 690
 			));
691
-		} catch( Exception $e ) {
692
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
691
+		} catch (Exception $e) {
692
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
693 693
 		}
694 694
 		return NULL;
695 695
 	}
@@ -703,34 +703,34 @@  discard block
 block discarded – undo
703 703
 	 * @param EE_Transaction $transaction
704 704
 	 * @return EE_Cart
705 705
 	 */
706
-	private function _get_registrations( EE_Transaction $transaction ) {
706
+	private function _get_registrations(EE_Transaction $transaction) {
707 707
 		// first step: grab the registrants  { : o
708
-		$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params );
708
+		$registrations = $transaction->registrations($this->checkout->reg_cache_where_params);
709 709
 		// verify registrations have been set
710
-		if ( empty( $registrations )) {
710
+		if (empty($registrations)) {
711 711
 			// if no cached registrations, then check the db
712
-			$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params );
712
+			$registrations = $transaction->registrations($this->checkout->reg_cache_where_params);
713 713
 			// still nothing ? well as long as this isn't a revisit
714
-			if ( empty( $registrations ) && ! $this->checkout->revisit ) {
714
+			if (empty($registrations) && ! $this->checkout->revisit) {
715 715
 				// generate new registrations from scratch
716
-				$registrations = $this->_initialize_registrations( $transaction );
716
+				$registrations = $this->_initialize_registrations($transaction);
717 717
 			}
718 718
 		}
719 719
 		// sort by their original registration order
720
-		usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' ));
720
+		usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
721 721
 		// then loop thru the array
722
-		foreach ( $registrations as $registration ) {
722
+		foreach ($registrations as $registration) {
723 723
 			// verify each registration
724
-			if ( $registration instanceof EE_Registration ) {
724
+			if ($registration instanceof EE_Registration) {
725 725
 				// we display all attendee info for the primary registrant
726
-				if ( $this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant() ) {
726
+				if ($this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) {
727 727
 					$this->checkout->primary_revisit = TRUE;
728 728
 					break;
729
-				} else if ( $this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link() ) {
729
+				} else if ($this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link()) {
730 730
 					// but hide info if it doesn't belong to you
731
-					$transaction->clear_cache( 'Registration', $registration->ID() );
731
+					$transaction->clear_cache('Registration', $registration->ID());
732 732
 				}
733
-				$this->checkout->set_reg_status_updated( $registration->ID(), false );
733
+				$this->checkout->set_reg_status_updated($registration->ID(), false);
734 734
 			}
735 735
 		}
736 736
 	}
@@ -744,37 +744,37 @@  discard block
 block discarded – undo
744 744
 	 * @param EE_Transaction $transaction
745 745
 	 * @return    array
746 746
 	 */
747
-	private function _initialize_registrations( EE_Transaction $transaction ) {
747
+	private function _initialize_registrations(EE_Transaction $transaction) {
748 748
 		$registrations = array();
749
-		if ( $transaction instanceof EE_Transaction ) {
749
+		if ($transaction instanceof EE_Transaction) {
750 750
 			/** @type EE_Registration_Processor $registration_processor */
751
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
751
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
752 752
 			$att_nmbr = 0;
753 753
 			$this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count();
754 754
 			// now let's add the cart items to the $transaction
755
-			foreach ( $this->checkout->cart->get_tickets() as $item ) {
755
+			foreach ($this->checkout->cart->get_tickets() as $item) {
756 756
 				// grab the related ticket object for this line_item
757 757
 				$ticket = $item->ticket();
758
-				if ( ! $ticket instanceof EE_Ticket ){
759
-					EE_Error::add_error(sprintf(__("Line item %s did not contain a valid ticket", "event_espresso"),$item->ID()), __FILE__, __FUNCTION__, __LINE__);
758
+				if ( ! $ticket instanceof EE_Ticket) {
759
+					EE_Error::add_error(sprintf(__("Line item %s did not contain a valid ticket", "event_espresso"), $item->ID()), __FILE__, __FUNCTION__, __LINE__);
760 760
 					break;
761 761
 				}
762
-				$first_datetime = $ticket->get_first_related( 'Datetime' );
763
-				if ( ! $first_datetime instanceof EE_Datetime ){
764
-					EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with any valid datetimes.", "event_espresso"),$ticket->name()), __FILE__, __FUNCTION__, __LINE__ );
762
+				$first_datetime = $ticket->get_first_related('Datetime');
763
+				if ( ! $first_datetime instanceof EE_Datetime) {
764
+					EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with any valid datetimes.", "event_espresso"), $ticket->name()), __FILE__, __FUNCTION__, __LINE__);
765 765
 					continue;
766 766
 				}
767
-				$event = $first_datetime->get_first_related( 'Event' );
768
-				if ( ! $event instanceof EE_Event ){
769
-					EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with a valid event.", "event_espresso"),$ticket->name()),__FILE__,__FUNCTION__,__LINE__);
767
+				$event = $first_datetime->get_first_related('Event');
768
+				if ( ! $event instanceof EE_Event) {
769
+					EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with a valid event.", "event_espresso"), $ticket->name()), __FILE__, __FUNCTION__, __LINE__);
770 770
 					continue;
771 771
 				}
772 772
 				//do the following for each ticket of this type they selected
773
-				for ( $x = 1; $x <= $item->quantity(); $x++ ) {
773
+				for ($x = 1; $x <= $item->quantity(); $x++) {
774 774
 					$att_nmbr++;
775
-					$reg_url_link = $registration_processor->generate_reg_url_link( $att_nmbr, $item );
775
+					$reg_url_link = $registration_processor->generate_reg_url_link($att_nmbr, $item);
776 776
 					// now create a new registration for the ticket
777
-					$registration = EE_Registration::new_instance( array(
777
+					$registration = EE_Registration::new_instance(array(
778 778
 						'EVT_ID' 					=> $event->ID(),
779 779
 						'TXN_ID' 					=> $transaction->ID(),
780 780
 						'TKT_ID' 					=> $ticket->ID(),
@@ -786,12 +786,12 @@  discard block
 block discarded – undo
786 786
 						'REG_group_size' 	=> $this->checkout->total_ticket_count,
787 787
 						'REG_url_link'			=> $reg_url_link
788 788
 					));
789
-					$registration->set_reg_code( $registration_processor->generate_reg_code( $registration ));
789
+					$registration->set_reg_code($registration_processor->generate_reg_code($registration));
790 790
 					$registration->save();
791
-					$registration->_add_relation_to( $event, 'Event', array(), $event->ID() );
792
-					$registration->_add_relation_to( $item->ticket(), 'Ticket', array(), $item->ticket()->ID() );
793
-					$transaction->_add_relation_to( $registration, 'Registration' );
794
-					$registrations[ $registration->ID() ] = $registration;
791
+					$registration->_add_relation_to($event, 'Event', array(), $event->ID());
792
+					$registration->_add_relation_to($item->ticket(), 'Ticket', array(), $item->ticket()->ID());
793
+					$transaction->_add_relation_to($registration, 'Registration');
794
+					$registrations[$registration->ID()] = $registration;
795 795
 				}
796 796
 			}
797 797
 		}
@@ -808,12 +808,12 @@  discard block
 block discarded – undo
808 808
 	 * @param EE_Registration $reg_B
809 809
 	 * @return array()
810 810
 	 */
811
-	public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) {
811
+	public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) {
812 812
 		// this shouldn't ever happen within the same TXN, but oh well
813
-		if ( $reg_A->count() == $reg_B->count() ) {
813
+		if ($reg_A->count() == $reg_B->count()) {
814 814
 			return 0;
815 815
 		}
816
-		return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1;
816
+		return ($reg_A->count() > $reg_B->count()) ? 1 : -1;
817 817
 	}
818 818
 
819 819
 
@@ -827,30 +827,30 @@  discard block
 block discarded – undo
827 827
 	 *  @return 	bool
828 828
 	 */
829 829
 	private function _final_verifications() {
830
-		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) {
831
-			EE_Error::add_error( __( 'We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
830
+		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
831
+			EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
832 832
 			return false;
833 833
 		}
834
-		if ( ! empty( $this->checkout->reg_url_link )) {
834
+		if ( ! empty($this->checkout->reg_url_link)) {
835 835
 			$valid_registrant = $this->checkout->transaction->primary_registration();
836
-			if ( ! $valid_registrant instanceof EE_Registration ) {
837
-				EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
836
+			if ( ! $valid_registrant instanceof EE_Registration) {
837
+				EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
838 838
 				return false;
839 839
 			}
840 840
 			$valid_registrant = null;
841
-			foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) {
842
-				if ( $registration instanceof EE_Registration ) {
843
-					if ( $registration->reg_url_link() == $this->checkout->reg_url_link ) {
841
+			foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
842
+				if ($registration instanceof EE_Registration) {
843
+					if ($registration->reg_url_link() == $this->checkout->reg_url_link) {
844 844
 						$valid_registrant = $registration;
845 845
 					}
846 846
 				}
847 847
 			}
848
-			if ( ! $valid_registrant instanceof EE_Registration ) {
849
-				EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
848
+			if ( ! $valid_registrant instanceof EE_Registration) {
849
+				EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
850 850
 				return false;
851 851
 			}
852 852
 		}
853
-		$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout );
853
+		$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
854 854
 		return true;
855 855
 	}
856 856
 
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 	 */
868 868
 	private function _initialize_reg_steps() {
869 869
 		/** @type EE_Transaction_Processor $transaction_processor */
870
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
870
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
871 871
 		// call set_reg_step_initiated ???
872 872
 		if (
873 873
 			// first time visiting SPCO ?
@@ -876,24 +876,24 @@  discard block
 block discarded – undo
876 876
 			&& $this->checkout->action === 'display_spco_reg_step'
877 877
 		) {
878 878
 			// set the start time for this reg step
879
-			if ( ! $transaction_processor->set_reg_step_initiated( $this->checkout->transaction, $this->checkout->current_step->slug() ) ) {
880
-				if ( WP_DEBUG ) {
881
-					EE_Error::add_error( sprintf(__( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ), $this->checkout->current_step->name() ), __FILE__, __FUNCTION__, __LINE__ );
879
+			if ( ! $transaction_processor->set_reg_step_initiated($this->checkout->transaction, $this->checkout->current_step->slug())) {
880
+				if (WP_DEBUG) {
881
+					EE_Error::add_error(sprintf(__('The "%1$s" registration step was not initialized properly.', 'event_espresso'), $this->checkout->current_step->name()), __FILE__, __FUNCTION__, __LINE__);
882 882
 				}
883 883
 			};
884 884
 		}
885 885
 		// loop thru all steps to call their individual "initialize" methods and set i18n strings for JS
886
-		foreach ( $this->checkout->reg_steps as $reg_step ) {
886
+		foreach ($this->checkout->reg_steps as $reg_step) {
887 887
 			$reg_step->initialize_reg_step();
888 888
 			// i18n
889 889
 			$reg_step->translate_js_strings();
890
-			if ( $reg_step->is_current_step() ) {
890
+			if ($reg_step->is_current_step()) {
891 891
 				// the text that appears on the reg step form submit button
892 892
 				$reg_step->set_submit_button_text();
893 893
 			}
894 894
 		}
895 895
 		// dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information
896
-		do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step );
896
+		do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step);
897 897
 	}
898 898
 
899 899
 
@@ -906,38 +906,38 @@  discard block
 block discarded – undo
906 906
 	 */
907 907
 	private function _check_form_submission() {
908 908
 		//does this request require the reg form to be generated ?
909
-		if ( $this->checkout->generate_reg_form ) {
909
+		if ($this->checkout->generate_reg_form) {
910 910
 			// ever heard that song by Blue Rodeo ?
911 911
 			try {
912 912
 				$this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form();
913 913
 				// if not displaying a form, then check for form submission
914
-				if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) {
914
+				if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) {
915 915
 					// clear out any old data in case this step is being run again
916
-					$this->checkout->current_step->set_valid_data( array() );
916
+					$this->checkout->current_step->set_valid_data(array());
917 917
 					// capture submitted form data
918 918
 					$this->checkout->current_step->reg_form->receive_form_submission(
919
-						apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout )
919
+						apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout)
920 920
 					);
921 921
 					// validate submitted form data
922
-					if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg ) {
922
+					if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg) {
923 923
 						// thou shall not pass !!!
924 924
 						$this->checkout->continue_reg = FALSE;
925 925
 						// any form validation errors?
926
-						if ( $this->checkout->current_step->reg_form->submission_error_message() != '' ) {
926
+						if ($this->checkout->current_step->reg_form->submission_error_message() != '') {
927 927
 							$submission_error_messages = array();
928 928
 							// bad, bad, bad registrant
929
-							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
930
-								if ( $validation_error instanceof EE_Validation_Error ) {
931
-									$submission_error_messages[] = sprintf( __( '%s : %s', 'event_espresso' ), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage() );
929
+							foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) {
930
+								if ($validation_error instanceof EE_Validation_Error) {
931
+									$submission_error_messages[] = sprintf(__('%s : %s', 'event_espresso'), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage());
932 932
 								}
933 933
 							}
934
-							EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
934
+							EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
935 935
 						}
936 936
 						// well not really... what will happen is we'll just get redirected back to redo the current step
937 937
 						$this->go_to_next_step();
938 938
 					}
939 939
 				}
940
-			} catch( EE_Error $e ) {
940
+			} catch (EE_Error $e) {
941 941
 				$e->get_error();
942 942
 			}
943 943
 		}
@@ -953,38 +953,38 @@  discard block
 block discarded – undo
953 953
 	 */
954 954
 	private function _process_form_action() {
955 955
 		// what cha wanna do?
956
-		switch( $this->checkout->action ) {
956
+		switch ($this->checkout->action) {
957 957
 			// AJAX next step reg form
958 958
 			case 'display_spco_reg_step' :
959 959
 				$this->checkout->redirect = FALSE;
960
-				if ( EE_Registry::instance()->REQ->ajax ) {
961
-					$this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() );
960
+				if (EE_Registry::instance()->REQ->ajax) {
961
+					$this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form());
962 962
 				}
963 963
 				break;
964 964
 
965 965
 			default :
966 966
 				// meh... do one of those other steps first
967
-				if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) {
967
+				if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) {
968 968
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step
969
-					do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
969
+					do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
970 970
 					// call action on current step
971
-					if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) {
971
+					if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) {
972 972
 						// good registrant, you get to proceed
973
-						if ( $this->checkout->current_step->success_message() != '' ) {
974
-							if ( apply_filters( 'FHEE__Single_Page_Checkout___process_form_action__display_success', false ) ) {
975
-								EE_Error::add_success( $this->checkout->current_step->success_message() . '<br />' . $this->checkout->next_step->_instructions() );
973
+						if ($this->checkout->current_step->success_message() != '') {
974
+							if (apply_filters('FHEE__Single_Page_Checkout___process_form_action__display_success', false)) {
975
+								EE_Error::add_success($this->checkout->current_step->success_message().'<br />'.$this->checkout->next_step->_instructions());
976 976
 							}
977 977
 						}
978 978
 						// pack it up, pack it in...
979 979
 						$this->_setup_redirect();
980 980
 					}
981 981
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step
982
-					do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
982
+					do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
983 983
 
984 984
 				} else {
985 985
 					EE_Error::add_error(
986 986
 						sprintf(
987
-							__( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ),
987
+							__('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'),
988 988
 							$this->checkout->action,
989 989
 							$this->checkout->current_step->name()
990 990
 						),
@@ -1008,10 +1008,10 @@  discard block
 block discarded – undo
1008 1008
 	 * 		@return 		void
1009 1009
 	 */
1010 1010
 	public function add_styles_and_scripts() {
1011
-		if ( $this->checkout->admin_request ) {
1012
-			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 );
1011
+		if ($this->checkout->admin_request) {
1012
+			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1013 1013
 		} else {
1014
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 );
1014
+			add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1015 1015
 		}
1016 1016
 	}
1017 1017
 
@@ -1027,45 +1027,45 @@  discard block
 block discarded – undo
1027 1027
 		EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit;
1028 1028
 		EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link;
1029 1029
 		EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso');
1030
-		EE_Registry::$i18n_js_strings['invalid_json_response'] = __( 'An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso' );
1031
-		EE_Registry::$i18n_js_strings['validation_error'] = __( 'There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso' );
1032
-		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso' );
1030
+		EE_Registry::$i18n_js_strings['invalid_json_response'] = __('An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso');
1031
+		EE_Registry::$i18n_js_strings['validation_error'] = __('There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso');
1032
+		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso');
1033 1033
 		EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso');
1034 1034
 		EE_Registry::$i18n_js_strings['invalid_coupon'] = __('We\'re sorry but that coupon code does not appear to be valid. If this is incorrect, please contact the site administrator.', 'event_espresso');
1035
-		EE_Registry::$i18n_js_strings['process_registration'] = sprintf( __( 'Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso' ), '<br/>', '<br/>' );
1036
-		EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' );
1035
+		EE_Registry::$i18n_js_strings['process_registration'] = sprintf(__('Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso'), '<br/>', '<br/>');
1036
+		EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language');
1037 1037
 		EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id();
1038 1038
 		EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20';
1039
-		EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' );
1040
-		EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' );
1041
-		EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' );
1042
-		EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' );
1043
-		EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' );
1044
-		EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' );
1045
-		EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' );
1046
-		EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' );
1047
-		EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' );
1048
-		EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' );
1049
-		EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' );
1050
-		EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' );
1051
-		EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' );
1052
-		EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' );
1039
+		EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso');
1040
+		EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso');
1041
+		EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso');
1042
+		EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso');
1043
+		EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso');
1044
+		EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso');
1045
+		EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso');
1046
+		EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso');
1047
+		EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso');
1048
+		EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso');
1049
+		EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso');
1050
+		EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso');
1051
+		EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso');
1052
+		EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso');
1053 1053
 		EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf(
1054
-			__( '%1$sWe\'re sorry, but you\'re registration time has expired
1054
+			__('%1$sWe\'re sorry, but you\'re registration time has expired
1055 1055
 			.%2$s%3$s%4$sIf you still wish to complete your registration, please
1056 1056
 			return to the %5$sEvent List%6$sEvent List%7$s and reselect your
1057 1057
 			tickets if available. Please except our apologies for any inconvenience this
1058
-			may have caused.%8$s', 'event_espresso' ),
1058
+			may have caused.%8$s', 'event_espresso'),
1059 1059
 			'<h4 class="important-notice">',
1060 1060
 			'</h4>',
1061 1061
 			'<br />',
1062 1062
 			'<p>',
1063
-			'<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="',
1063
+			'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1064 1064
 			'">',
1065 1065
 			'</a>',
1066 1066
 			'</p>'
1067 1067
 		);
1068
-		EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true );
1068
+		EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true);
1069 1069
 	}
1070 1070
 
1071 1071
 
@@ -1078,28 +1078,28 @@  discard block
 block discarded – undo
1078 1078
 	 */
1079 1079
 	public function enqueue_styles_and_scripts() {
1080 1080
 		// load css
1081
-		wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION );
1082
-		wp_enqueue_style( 'single_page_checkout' );
1081
+		wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION);
1082
+		wp_enqueue_style('single_page_checkout');
1083 1083
 		// i18n
1084 1084
 		$this->translate_js_strings();
1085 1085
 		// load JS
1086
-		wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery	.plugin.min.js', array( 'jquery' ), '1.0.1', TRUE );
1087
-		wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery	.countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE );
1088
-		wp_register_script( 'single_page_checkout', SPCO_JS_URL . 'single_page_checkout.js', array( 'espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown' ), EVENT_ESPRESSO_VERSION, TRUE );
1089
-		wp_enqueue_script( 'single_page_checkout' );
1090
-		wp_localize_script( 'single_page_checkout', 'eei18n', EE_Registry::$i18n_js_strings );
1086
+		wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery	.plugin.min.js', array('jquery'), '1.0.1', TRUE);
1087
+		wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery	.countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE);
1088
+		wp_register_script('single_page_checkout', SPCO_JS_URL.'single_page_checkout.js', array('espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown'), EVENT_ESPRESSO_VERSION, TRUE);
1089
+		wp_enqueue_script('single_page_checkout');
1090
+		wp_localize_script('single_page_checkout', 'eei18n', EE_Registry::$i18n_js_strings);
1091 1091
 
1092 1092
 		/**
1093 1093
 		 * global action hook for enqueueing styles and scripts with
1094 1094
 		 * spco calls.
1095 1095
 		 */
1096
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this );
1096
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this);
1097 1097
 
1098 1098
 		/**
1099 1099
 		 * dynamic action hook for enqueueing styles and scripts with spco calls.
1100 1100
 		 * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information
1101 1101
 		 */
1102
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this );
1102
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this);
1103 1103
 
1104 1104
 		// add css and JS for current step
1105 1105
 		$this->checkout->current_step->enqueue_styles_and_scripts();
@@ -1115,11 +1115,11 @@  discard block
 block discarded – undo
1115 1115
 	 */
1116 1116
 	private function _display_spco_reg_form() {
1117 1117
 		// if registering via the admin, just display the reg form for the current step
1118
-		if ( $this->checkout->admin_request ) {
1119
-			EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() );
1118
+		if ($this->checkout->admin_request) {
1119
+			EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form());
1120 1120
 		} else {
1121 1121
 			// add powered by EE msg
1122
-			add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' ));
1122
+			add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer'));
1123 1123
 			$this->checkout->registration_form = new EE_Form_Section_Proper(
1124 1124
 				array(
1125 1125
 					'name' 	=> 'single-page-checkout',
@@ -1127,17 +1127,17 @@  discard block
 block discarded – undo
1127 1127
 					'layout_strategy' =>
1128 1128
 						new EE_Template_Layout(
1129 1129
 							array(
1130
-								'layout_template_file' 			=> SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php',
1130
+								'layout_template_file' 			=> SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php',
1131 1131
 								'template_args' => array(
1132
-									'empty_cart' 		=> count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params )) < 1 ? TRUE : FALSE,
1132
+									'empty_cart' 		=> count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? TRUE : FALSE,
1133 1133
 									'revisit' 				=> $this->checkout->revisit,
1134 1134
 									'reg_steps' 			=> $this->checkout->reg_steps,
1135 1135
 									'next_step' 			=>  $this->checkout->next_step instanceof EE_SPCO_Reg_Step ? $this->checkout->next_step->slug() : '',
1136 1136
 									'empty_msg' 		=> apply_filters(
1137 1137
 										'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg',
1138 1138
 										sprintf(
1139
-											__( 'You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso' ),
1140
-											'<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="',
1139
+											__('You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso'),
1140
+											'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1141 1141
 											'">',
1142 1142
 											'</a>'
1143 1143
 										)
@@ -1145,16 +1145,16 @@  discard block
 block discarded – undo
1145 1145
 									'registration_time_limit' =>
1146 1146
 										$this->checkout->get_registration_time_limit(),
1147 1147
 									'session_expiration' =>
1148
-										gmdate( 'M d, Y H:i:s',
1148
+										gmdate('M d, Y H:i:s',
1149 1149
 											EE_Registry::instance()
1150
-											->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) )
1150
+											->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS))
1151 1151
 								)
1152 1152
 							)
1153 1153
 						)
1154 1154
 				)
1155 1155
 			);
1156 1156
 			// load template and add to output sent that gets filtered into the_content()
1157
-			EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html_and_js() );
1157
+			EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html_and_js());
1158 1158
 		}
1159 1159
 	}
1160 1160
 
@@ -1168,8 +1168,8 @@  discard block
 block discarded – undo
1168 1168
 	 * @internal  param string $label
1169 1169
 	 * @return        string
1170 1170
 	 */
1171
-	public function add_extra_finalize_registration_inputs( $next_step ) {
1172
-		if ( $next_step == 'finalize_registration' ) {
1171
+	public function add_extra_finalize_registration_inputs($next_step) {
1172
+		if ($next_step == 'finalize_registration') {
1173 1173
 			echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>';
1174 1174
 		}
1175 1175
 	}
@@ -1183,18 +1183,18 @@  discard block
 block discarded – undo
1183 1183
 	 *  @return 	string
1184 1184
 	 */
1185 1185
 	public static function display_registration_footer() {
1186
-		if ( apply_filters( 'FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer ) ) {
1187
-			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1188
-			$url = add_query_arg( array( 'ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id ), 'http://eventespresso.com/' );
1189
-			$url = apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url );
1186
+		if (apply_filters('FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer)) {
1187
+			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1188
+			$url = add_query_arg(array('ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id), 'http://eventespresso.com/');
1189
+			$url = apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url);
1190 1190
 			echo apply_filters(
1191 1191
 				'FHEE__EE_Front_Controller__display_registration_footer',
1192 1192
 				sprintf(
1193
-					__( '%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso' ),
1194
-					'<div id="espresso-registration-footer-dv"><a href="' . $url . '" title="',
1193
+					__('%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso'),
1194
+					'<div id="espresso-registration-footer-dv"><a href="'.$url.'" title="',
1195 1195
 					'" target="_blank">',
1196 1196
 					'</a>',
1197
-					'<a href="' . $url . '" title="',
1197
+					'<a href="'.$url.'" title="',
1198 1198
 					'" target="_blank">',
1199 1199
 					'</a></div>'
1200 1200
 				)
@@ -1225,12 +1225,12 @@  discard block
 block discarded – undo
1225 1225
 	 * @return 	array
1226 1226
 	 */
1227 1227
 	private function _setup_redirect() {
1228
-		if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
1228
+		if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
1229 1229
 			$this->checkout->redirect = TRUE;
1230
-			if ( empty( $this->checkout->redirect_url )) {
1230
+			if (empty($this->checkout->redirect_url)) {
1231 1231
 				$this->checkout->redirect_url = $this->checkout->next_step->reg_step_url();
1232 1232
 			}
1233
-			$this->checkout->redirect_url = apply_filters( 'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout );
1233
+			$this->checkout->redirect_url = apply_filters('FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout);
1234 1234
 		}
1235 1235
 	}
1236 1236
 
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
 	 * @return void
1244 1244
 	 */
1245 1245
 	public function go_to_next_step() {
1246
-		if ( $this->checkout->admin_request || $this->checkout->action == 'redirect_form' ) {
1246
+		if ($this->checkout->admin_request || $this->checkout->action == 'redirect_form') {
1247 1247
 			return;
1248 1248
 		}
1249 1249
 		// AJAX response
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
 	 */
1265 1265
 	protected function _handle_json_response() {
1266 1266
 		// if this is an ajax request
1267
-		if ( EE_Registry::instance()->REQ->ajax ) {
1267
+		if (EE_Registry::instance()->REQ->ajax) {
1268 1268
 			// DEBUG LOG
1269 1269
 			//$this->checkout->log(
1270 1270
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1274,9 +1274,9 @@  discard block
 block discarded – undo
1274 1274
 			//		'continue_reg'               => $this->checkout->continue_reg,
1275 1275
 			//	)
1276 1276
 			//);
1277
-			$this->checkout->json_response->set_registration_time_limit( $this->checkout->get_registration_time_limit() );
1277
+			$this->checkout->json_response->set_registration_time_limit($this->checkout->get_registration_time_limit());
1278 1278
 			// just send the ajax (
1279
-			$json_response = apply_filters( 'FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response );
1279
+			$json_response = apply_filters('FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response);
1280 1280
 			$this->unlock_transaction();
1281 1281
 			echo $json_response;
1282 1282
 			exit();
@@ -1293,9 +1293,9 @@  discard block
 block discarded – undo
1293 1293
 	 */
1294 1294
 	protected function _handle_html_redirects() {
1295 1295
 		// going somewhere ?
1296
-		if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) {
1296
+		if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) {
1297 1297
 			// store notices in a transient
1298
-			EE_Error::get_notices( false, true, true );
1298
+			EE_Error::get_notices(false, true, true);
1299 1299
 			$this->unlock_transaction();
1300 1300
 			// DEBUG LOG
1301 1301
 			//$this->checkout->log(
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 			//		'headers_list'    => headers_list(),
1307 1307
 			//	)
1308 1308
 			//);
1309
-			wp_safe_redirect( $this->checkout->redirect_url );
1309
+			wp_safe_redirect($this->checkout->redirect_url);
1310 1310
 			exit();
1311 1311
 		}
1312 1312
 	}
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_Checkout.class.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_Checkout
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_Checkout
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_Checkout {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
 	/**
263 263
 	 * @param $REG_ID
264
-	 * @param $reg_status
264
+	 * @param boolean $reg_status
265 265
 	 */
266 266
 	public function set_reg_status_updated( $REG_ID, $reg_status ) {
267 267
 		$this->reg_status_updated[ $REG_ID ] = $reg_status;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	 * 	reset_reg_steps
516 516
 	 *
517 517
 	 * 	@access public
518
-	 * 	@return 	bool
518
+	 * 	@return 	boolean|null
519 519
 	 */
520 520
 	public function reset_reg_steps() {
521 521
 		$this->sort_reg_steps();
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 	 * 	stash_transaction_and_checkout
607 607
 	 *
608 608
 	 * 	@access public
609
-	 * 	@return 	bool
609
+	 * 	@return 	boolean|null
610 610
 	 */
611 611
 	public function stash_transaction_and_checkout() {
612 612
 		if ( ! $this->revisit ) {
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 	 * 	stores whether any updates were made to the TXN or it's related registrations
629 629
 	 *
630 630
 	 * 	@access public
631
-	 * 	@return 	bool
631
+	 * 	@return 	boolean|null
632 632
 	 */
633 633
 	public function track_transaction_and_registration_status_updates() {
634 634
 		// verify the transaction
@@ -969,6 +969,7 @@  discard block
 block discarded – undo
969 969
 	 *
970 970
 	 * @param 	string | int 	$reg_cache_ID
971 971
 	 * @param 	EE_Registration 	$registration
972
+	 * @param integer $reg_cache_ID
972 973
 	 * @return void
973 974
 	 */
974 975
 	protected function _refresh_registration( $reg_cache_ID, $registration ) {
Please login to merge, or discard this patch.
Spacing   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 		$this->reg_page_base_url = EE_Registry::instance()->CFG->core->reg_page_url();
243 243
 		$this->thank_you_page_url = EE_Registry::instance()->CFG->core->thank_you_page_url();
244 244
 		$this->cancel_page_url = EE_Registry::instance()->CFG->core->cancel_page_url();
245
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', TRUE );
245
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', TRUE);
246 246
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax;
247
-		$this->reg_cache_where_params = array( 'order_by' => array( 'REG_count' => 'ASC' ));
247
+		$this->reg_cache_where_params = array('order_by' => array('REG_count' => 'ASC'));
248 248
 	}
249 249
 
250 250
 
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 	 * @param $REG_ID
254 254
 	 * @return array
255 255
 	 */
256
-	public function reg_status_updated( $REG_ID ) {
257
-		return isset( $this->reg_status_updated[ $REG_ID ] ) ? $this->reg_status_updated[ $REG_ID ] : false;
256
+	public function reg_status_updated($REG_ID) {
257
+		return isset($this->reg_status_updated[$REG_ID]) ? $this->reg_status_updated[$REG_ID] : false;
258 258
 	}
259 259
 
260 260
 
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
 	 * @param $REG_ID
264 264
 	 * @param $reg_status
265 265
 	 */
266
-	public function set_reg_status_updated( $REG_ID, $reg_status ) {
267
-		$this->reg_status_updated[ $REG_ID ] = $reg_status;
266
+	public function set_reg_status_updated($REG_ID, $reg_status) {
267
+		$this->reg_status_updated[$REG_ID] = $reg_status;
268 268
 	}
269 269
 
270 270
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * can ONLY be set by the  Finalize_Registration reg step
286 286
 	 */
287 287
 	public function set_exit_spco() {
288
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
288
+		if ($this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
289 289
 			$this->exit_spco = true;
290 290
 		}
291 291
 	}
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 	 * @return    void
302 302
 	 */
303 303
 	public function reset_for_current_request() {
304
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', true );
304
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', true);
305 305
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax;
306 306
 		$this->continue_reg = true;
307 307
 		$this->redirect = false;
308 308
 		// don't reset the cached redirect form if we're about to be asked to display it !!!
309
-		if ( EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ) !== 'redirect_form' ) {
309
+		if (EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step') !== 'redirect_form') {
310 310
 			$this->redirect_form = '';
311 311
 		}
312 312
 		$this->redirect_url = '';
@@ -323,8 +323,8 @@  discard block
 block discarded – undo
323 323
 	 * @param EE_SPCO_Reg_Step $reg_step_obj
324 324
 	 * @return    void
325 325
 	 */
326
-	public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) {
327
-		$this->reg_steps[ $reg_step_obj->slug()  ] = $reg_step_obj;
326
+	public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) {
327
+		$this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj;
328 328
 	}
329 329
 
330 330
 
@@ -336,13 +336,13 @@  discard block
 block discarded – undo
336 336
 	 * @param string $reg_step_slug
337 337
 	 * @return    void
338 338
 	 */
339
-	public function remove_reg_step( $reg_step_slug = '' ) {
340
-		unset( $this->reg_steps[ $reg_step_slug  ] );
341
-		if ( $this->transaction instanceof EE_Transaction ) {
339
+	public function remove_reg_step($reg_step_slug = '') {
340
+		unset($this->reg_steps[$reg_step_slug]);
341
+		if ($this->transaction instanceof EE_Transaction) {
342 342
 			/** @type EE_Transaction_Processor $transaction_processor */
343
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
343
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
344 344
 			// now remove reg step from TXN and save
345
-			$transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug );
345
+			$transaction_processor->remove_reg_step($this->transaction, $reg_step_slug);
346 346
 			$this->transaction->save();
347 347
 		}
348 348
 	}
@@ -357,9 +357,9 @@  discard block
 block discarded – undo
357 357
 	 * @param int    $order
358 358
 	 * @return    void
359 359
 	 */
360
-	public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) {
361
-		if ( isset( $this->reg_steps[ $reg_step_slug  ] )) {
362
-			$this->reg_steps[ $reg_step_slug ]->set_order( $order );
360
+	public function set_reg_step_order($reg_step_slug = '', $order = 100) {
361
+		if (isset($this->reg_steps[$reg_step_slug])) {
362
+			$this->reg_steps[$reg_step_slug]->set_order($order);
363 363
 		}
364 364
 	}
365 365
 
@@ -372,25 +372,25 @@  discard block
 block discarded – undo
372 372
 	 * @param string $current_step
373 373
 	 * @return    void
374 374
 	 */
375
-	public function set_current_step( $current_step ) {
375
+	public function set_current_step($current_step) {
376 376
 		// grab what step we're on
377
-		$this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps );
377
+		$this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps);
378 378
 		// verify instance
379
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step ) {
379
+		if ($this->current_step instanceof EE_SPCO_Reg_Step) {
380 380
 			// we don't want to repeat completed steps if this is the first time through SPCO
381
-			if ( $this->continue_reg && $this->current_step->completed() && ! $this->revisit ) {
381
+			if ($this->continue_reg && $this->current_step->completed() && ! $this->revisit) {
382 382
 				// so advance to the next step
383 383
 				$this->set_next_step();
384
-				if ( $this->next_step instanceof EE_SPCO_Reg_Step ) {
384
+				if ($this->next_step instanceof EE_SPCO_Reg_Step) {
385 385
 					// and attempt to set it as the current step
386
-					$this->set_current_step( $this->next_step->slug() );
386
+					$this->set_current_step($this->next_step->slug());
387 387
 				}
388 388
 				return;
389 389
 			}
390
-			$this->current_step->set_is_current_step( TRUE );
390
+			$this->current_step->set_is_current_step(TRUE);
391 391
 		} else {
392 392
 			EE_Error::add_error(
393
-				__( 'The current step could not be set.', 'event_espresso' ),
393
+				__('The current step could not be set.', 'event_espresso'),
394 394
 				__FILE__, __FUNCTION__, __LINE__
395 395
 			);
396 396
 		}
@@ -407,20 +407,20 @@  discard block
 block discarded – undo
407 407
 	 */
408 408
 	public function set_next_step() {
409 409
 		// set pointer to start of array
410
-		reset( $this->reg_steps );
410
+		reset($this->reg_steps);
411 411
 		// if there is more than one step
412
-		if ( count( $this->reg_steps ) > 1 ) {
412
+		if (count($this->reg_steps) > 1) {
413 413
 			// advance to the current step and set pointer
414
-			while ( key( $this->reg_steps ) != $this->current_step->slug() && key( $this->reg_steps ) != '' ) {
415
-				next( $this->reg_steps );
414
+			while (key($this->reg_steps) != $this->current_step->slug() && key($this->reg_steps) != '') {
415
+				next($this->reg_steps);
416 416
 			}
417 417
 		}
418 418
 		// advance one more spot ( if it exists )
419
-		$this->next_step = next( $this->reg_steps );
419
+		$this->next_step = next($this->reg_steps);
420 420
 		// verify instance
421
-		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step  : NULL;
421
+		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL;
422 422
 		// then back to current step to reset
423
-		prev( $this->reg_steps );
423
+		prev($this->reg_steps);
424 424
 	}
425 425
 
426 426
 
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
 	 *  @return 	EE_SPCO_Reg_Step | null
435 435
 	 */
436 436
 	public function get_next_reg_step() {
437
-		$next = next( $this->reg_steps );
438
-		prev( $this->reg_steps );
437
+		$next = next($this->reg_steps);
438
+		prev($this->reg_steps);
439 439
 		return $next instanceof EE_SPCO_Reg_Step ? $next : null;
440 440
 	}
441 441
 
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
 	 *  @return 	EE_SPCO_Reg_Step | null
451 451
 	 */
452 452
 	public function get_prev_reg_step() {
453
-		$prev = prev( $this->reg_steps );
454
-		next( $this->reg_steps );
453
+		$prev = prev($this->reg_steps);
454
+		next($this->reg_steps);
455 455
 		return $prev instanceof EE_SPCO_Reg_Step ? $prev : null;
456 456
 	}
457 457
 
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 	 * @return void
465 465
 	 */
466 466
 	public function sort_reg_steps() {
467
-		$reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' );
468
-		uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback ));
467
+		$reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback');
468
+		uasort($this->reg_steps, array($this, $reg_step_sorting_callback));
469 469
 	}
470 470
 
471 471
 
@@ -478,17 +478,17 @@  discard block
 block discarded – undo
478 478
 	 * @param EE_SPCO_Reg_Step $reg_step_B
479 479
 	 * @return array()
480 480
 	 */
481
-	public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) {
481
+	public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) {
482 482
 		// send finalize_registration step to the end of the array
483
-		if ( $reg_step_A->slug() == 'finalize_registration' ) {
483
+		if ($reg_step_A->slug() == 'finalize_registration') {
484 484
 			return 1;
485
-		} else if ( $reg_step_B->slug() == 'finalize_registration' ) {
485
+		} else if ($reg_step_B->slug() == 'finalize_registration') {
486 486
 			return -1;
487 487
 		}
488
-		if ( $reg_step_A->order() == $reg_step_B->order() ) {
488
+		if ($reg_step_A->order() == $reg_step_B->order()) {
489 489
 			return 0;
490 490
 		}
491
-		return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1;
491
+		return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1;
492 492
 	}
493 493
 
494 494
 
@@ -500,10 +500,10 @@  discard block
 block discarded – undo
500 500
 	 * 	@return 	void
501 501
 	 */
502 502
 	public function set_reg_step_JSON_info() {
503
-		EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array();
503
+		EE_Registry::$i18n_js_strings['reg_steps'] = array();
504 504
 		// pass basic reg step data to JS
505
-		foreach ( $this->reg_steps as $reg_step ) {
506
-			EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug();
505
+		foreach ($this->reg_steps as $reg_step) {
506
+			EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug();
507 507
 		}
508 508
 		// reset reg step html
509 509
 //		$this->json_response->set_reg_step_html( '' );
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	 */
520 520
 	public function reset_reg_steps() {
521 521
 		$this->sort_reg_steps();
522
-		$this->set_current_step( EE_Registry::instance()->REQ->get( 'step' ));
522
+		$this->set_current_step(EE_Registry::instance()->REQ->get('step'));
523 523
 		$this->set_next_step();
524 524
 		// the text that appears on the reg step form submit button
525 525
 		$this->current_step->set_submit_button_text();
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 	 */
537 537
 	public function get_registration_time_limit() {
538 538
 
539
-		$registration_time_limit = (float)( EE_Registry::instance()	->SSN->expiration() - time() );
539
+		$registration_time_limit = (float) (EE_Registry::instance()	->SSN->expiration() - time());
540 540
 		$time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s';
541
-		$registration_time_limit = gmdate( $time_limit_format, $registration_time_limit );
541
+		$registration_time_limit = gmdate($time_limit_format, $registration_time_limit);
542 542
 		return apply_filters(
543 543
 			'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit',
544 544
 			$registration_time_limit
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		//		overpaid TXN
559 559
 		//		free TXN ( total = 0.00 )
560 560
 		// then payment required is TRUE
561
-		return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE;
561
+		return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE;
562 562
 	}
563 563
 
564 564
 
@@ -571,8 +571,8 @@  discard block
 block discarded – undo
571 571
 	 */
572 572
 	public function initialize_txn_reg_steps_array() {
573 573
 		$txn_reg_steps_array = array();
574
-		foreach ( $this->reg_steps as $reg_step ) {
575
-			$txn_reg_steps_array[ $reg_step->slug() ] = FALSE;
574
+		foreach ($this->reg_steps as $reg_step) {
575
+			$txn_reg_steps_array[$reg_step->slug()] = FALSE;
576 576
 		}
577 577
 		return $txn_reg_steps_array;
578 578
 	}
@@ -588,13 +588,13 @@  discard block
 block discarded – undo
588 588
 	public function update_txn_reg_steps_array() {
589 589
 		$updated = FALSE;
590 590
 		/** @type EE_Transaction_Processor $transaction_processor */
591
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
592
-		foreach ( $this->reg_steps as $reg_step ) {
593
-			if ( $reg_step->completed() ) {
594
-				$updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() ) ? TRUE : $updated;
591
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
592
+		foreach ($this->reg_steps as $reg_step) {
593
+			if ($reg_step->completed()) {
594
+				$updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug()) ? TRUE : $updated;
595 595
 			}
596 596
 		}
597
-		if ( $updated ) {
597
+		if ($updated) {
598 598
 			$this->transaction->save();
599 599
 		}
600 600
 		return $updated;
@@ -609,14 +609,14 @@  discard block
 block discarded – undo
609 609
 	 * 	@return 	bool
610 610
 	 */
611 611
 	public function stash_transaction_and_checkout() {
612
-		if ( ! $this->revisit ) {
612
+		if ( ! $this->revisit) {
613 613
 			$this->update_txn_reg_steps_array();
614 614
 		}
615 615
 		$this->track_transaction_and_registration_status_updates();
616 616
 		// save all data to the db, but suppress errors
617 617
 		//$this->save_all_data( FALSE );
618 618
 		// cache the checkout in the session
619
-		EE_Registry::instance()->SSN->set_checkout( $this );
619
+		EE_Registry::instance()->SSN->set_checkout($this);
620 620
 	}
621 621
 
622 622
 
@@ -632,21 +632,21 @@  discard block
 block discarded – undo
632 632
 	 */
633 633
 	public function track_transaction_and_registration_status_updates() {
634 634
 		// verify the transaction
635
-		if ( $this->transaction instanceof EE_Transaction ) {
635
+		if ($this->transaction instanceof EE_Transaction) {
636 636
 			/** @type EE_Transaction_Payments $transaction_payments */
637
-			$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
637
+			$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
638 638
 			/** @type EE_Transaction_Processor $transaction_processor */
639
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
639
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
640 640
 			// has there been a TXN status change during this checkout?
641
-			if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) {
641
+			if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) {
642 642
 				$this->txn_status_updated = true;
643 643
 			}
644 644
 			/** @type EE_Registration_Processor $registration_processor */
645
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
645
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
646 646
 			// grab the saved registrations from the transaction
647
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) {
648
-				if ( $registration_processor->reg_status_updated( $registration->ID() ) ) {
649
-					$this->set_reg_status_updated( $registration->ID(), true );
647
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) {
648
+				if ($registration_processor->reg_status_updated($registration->ID())) {
649
+					$this->set_reg_status_updated($registration->ID(), true);
650 650
 				}
651 651
 			}
652 652
 		}
@@ -668,8 +668,8 @@  discard block
 block discarded – undo
668 668
 	 * @param 	EE_Registration 	$registration
669 669
 	 * 	@return 	bool
670 670
 	 */
671
-	public function visit_allows_processing_of_this_registration( EE_Registration $registration ) {
672
-		return ! $this->revisit || $this->primary_revisit || ( $this->revisit && $this->reg_url_link == $registration->reg_url_link() ) ? TRUE : FALSE;
671
+	public function visit_allows_processing_of_this_registration(EE_Registration $registration) {
672
+		return ! $this->revisit || $this->primary_revisit || ($this->revisit && $this->reg_url_link == $registration->reg_url_link()) ? TRUE : FALSE;
673 673
 	}
674 674
 
675 675
 
@@ -694,18 +694,18 @@  discard block
 block discarded – undo
694 694
 	 * @param bool $show_errors
695 695
 	 * @return bool
696 696
 	 */
697
-	public function save_all_data( $show_errors = TRUE ) {
697
+	public function save_all_data($show_errors = TRUE) {
698 698
 		// verify the transaction
699
-		if ( $this->transaction instanceof EE_Transaction ) {
699
+		if ($this->transaction instanceof EE_Transaction) {
700 700
 			// save to ensure that TXN has ID
701 701
 			$this->transaction->save();
702 702
 			// grab the saved registrations from the transaction
703
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as  $registration ) {
704
-				$this->_save_registration( $registration, $show_errors );
703
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as  $registration) {
704
+				$this->_save_registration($registration, $show_errors);
705 705
 			}
706 706
 		} else {
707
-			if ( $show_errors ) {
708
-				EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
707
+			if ($show_errors) {
708
+				EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
709 709
 			}
710 710
 			return FALSE;
711 711
 		}
@@ -720,32 +720,32 @@  discard block
 block discarded – undo
720 720
 	 * @param bool $show_errors
721 721
 	 * @return void
722 722
 	 */
723
-	private function _save_registration( $registration, $show_errors = TRUE  ) {
723
+	private function _save_registration($registration, $show_errors = TRUE) {
724 724
 		// verify object
725
-		if ( $registration instanceof EE_Registration ) {
725
+		if ($registration instanceof EE_Registration) {
726 726
 			// should this registration be processed during this visit ?
727
-			if ( $this->visit_allows_processing_of_this_registration( $registration ) ) {
727
+			if ($this->visit_allows_processing_of_this_registration($registration)) {
728 728
 				//set TXN ID
729
-				if ( ! $registration->transaction_ID() ) {
730
-					$registration->set_transaction_id( $this->transaction->ID() );
729
+				if ( ! $registration->transaction_ID()) {
730
+					$registration->set_transaction_id($this->transaction->ID());
731 731
 				}
732 732
 				// verify and save the attendee
733
-				$this->_save_registration_attendee( $registration, $show_errors );
733
+				$this->_save_registration_attendee($registration, $show_errors);
734 734
 				// save answers to reg form questions
735
-				$this->_save_registration_answers( $registration, $show_errors );
735
+				$this->_save_registration_answers($registration, $show_errors);
736 736
 				// save changes
737 737
 				$registration->save();
738 738
 				// update txn cache
739
-				if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) {
740
-					if ( $show_errors ) {
741
-						EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
739
+				if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) {
740
+					if ($show_errors) {
741
+						EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
742 742
 					}
743 743
 				}
744 744
 			}
745 745
 		} else {
746
-			if ( $show_errors ) {
746
+			if ($show_errors) {
747 747
 				EE_Error::add_error(
748
-					__( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ),
748
+					__('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'),
749 749
 					__FILE__, __FUNCTION__, __LINE__
750 750
 				);
751 751
 			}
@@ -761,26 +761,26 @@  discard block
 block discarded – undo
761 761
 	 * @param bool $show_errors
762 762
 	 * @return void
763 763
 	 */
764
-	private function _save_registration_attendee( $registration, $show_errors = TRUE ) {
765
-		if ( $registration->attendee() instanceof EE_Attendee ) {
764
+	private function _save_registration_attendee($registration, $show_errors = TRUE) {
765
+		if ($registration->attendee() instanceof EE_Attendee) {
766 766
 			// save so that ATT has ID
767 767
 			$registration->attendee()->save();
768
-			if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() )) {
769
-				if ( $show_errors ) {
768
+			if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) {
769
+				if ($show_errors) {
770 770
 					EE_Error::add_error(
771
-						__( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ),
771
+						__('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'),
772 772
 						__FILE__, __FUNCTION__, __LINE__
773 773
 					);
774 774
 				}
775 775
 			}
776 776
 		} else {
777
-			if ( $show_errors ) {
777
+			if ($show_errors) {
778 778
 				ob_start();
779
-				var_dump( $registration->attendee() );
779
+				var_dump($registration->attendee());
780 780
 				EE_Error::add_error(
781 781
 					sprintf(
782 782
 						'%1$s||%1$s $attendee = %2$s',
783
-						__( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ),
783
+						__('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'),
784 784
 						ob_get_clean()
785 785
 					),
786 786
 					__FILE__, __FUNCTION__, __LINE__
@@ -798,25 +798,25 @@  discard block
 block discarded – undo
798 798
 	 * @param bool $show_errors
799 799
 	 * @return void
800 800
 	 */
801
-	private function _save_registration_answers( $registration, $show_errors = TRUE ) {
801
+	private function _save_registration_answers($registration, $show_errors = TRUE) {
802 802
 		// now save the answers
803
-		foreach ( $registration->answers() as $cache_key => $answer ) {
803
+		foreach ($registration->answers() as $cache_key => $answer) {
804 804
 			// verify object
805
-			if ( $answer instanceof EE_Answer ) {
806
-				$answer->set_registration( $registration->ID() );
805
+			if ($answer instanceof EE_Answer) {
806
+				$answer->set_registration($registration->ID());
807 807
 				$answer->save();
808
-				if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) {
809
-					if ( $show_errors ) {
808
+				if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) {
809
+					if ($show_errors) {
810 810
 						EE_Error::add_error(
811
-							__( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ),
811
+							__('The newly saved Answer object could not be cached on the registration.', 'event_espresso'),
812 812
 							__FILE__, __FUNCTION__, __LINE__
813 813
 						);
814 814
 					}
815 815
 				}
816 816
 			} else {
817
-				if ( $show_errors ) {
817
+				if ($show_errors) {
818 818
 					EE_Error::add_error(
819
-						__( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ),
819
+						__('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'),
820 820
 						__FILE__, __FUNCTION__, __LINE__
821 821
 					);
822 822
 				}
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 	 * @param bool $from_db
835 835
 	 * @return bool
836 836
 	 */
837
-	public function refresh_all_entities( $from_db = false ) {
837
+	public function refresh_all_entities($from_db = false) {
838 838
 		$from_db = $this->current_step->is_final_step() || $this->action == 'process_gateway_response' ? true : $from_db;
839 839
 		//$this->log(
840 840
 		//	__CLASS__, __FUNCTION__, __LINE__,
@@ -855,11 +855,11 @@  discard block
 block discarded – undo
855 855
 	 */
856 856
 	protected function refresh_from_db() {
857 857
 		// verify the transaction
858
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
858
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
859 859
 			// pull fresh TXN data from the db
860
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() );
860
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID());
861 861
 			// update EE_Checkout's cached primary_attendee object
862
-			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction );
862
+			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction);
863 863
 			// update EE_Checkout's cached payment object
864 864
 			$payment = $this->transaction->last_payment();
865 865
 			$this->payment = $payment instanceof EE_Payment ? $payment : null;
@@ -867,13 +867,13 @@  discard block
 block discarded – undo
867 867
 			$payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null;
868 868
 			$this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : null;
869 869
 			//now refresh the cart, based on the TXN
870
-			$this->cart = EE_Cart::get_cart_from_txn( $this->transaction );
870
+			$this->cart = EE_Cart::get_cart_from_txn($this->transaction);
871 871
 			// verify cart
872
-			if ( ! $this->cart instanceof EE_Cart ) {
873
-				$this->cart = EE_Registry::instance()->load_core( 'Cart' );
872
+			if ( ! $this->cart instanceof EE_Cart) {
873
+				$this->cart = EE_Registry::instance()->load_core('Cart');
874 874
 			}
875 875
 		} else {
876
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
876
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
877 877
 			return FALSE;
878 878
 		}
879 879
 		return TRUE;
@@ -887,24 +887,24 @@  discard block
 block discarded – undo
887 887
 	 * @param   EE_Transaction $transaction
888 888
 	 * @return  EE_Attendee | null
889 889
 	 */
890
-	protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) {
890
+	protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) {
891 891
 
892 892
 		$primary_attendee_obj = null;
893 893
 		// grab the saved registrations from the transaction
894
-		foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) {
894
+		foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) {
895 895
 			// verify object
896
-			if ( $registration instanceof EE_Registration ) {
896
+			if ($registration instanceof EE_Registration) {
897 897
 				$attendee = $registration->attendee();
898 898
 				// verify object
899
-				if ( $attendee instanceof EE_Attendee  ) {
899
+				if ($attendee instanceof EE_Attendee) {
900 900
 					// maybe cache primary_attendee_obj ?
901
-					if ( $registration->is_primary_registrant() ) {
901
+					if ($registration->is_primary_registrant()) {
902 902
 						$primary_attendee_obj = $attendee;
903 903
 					}
904 904
 				}
905 905
 			} else {
906 906
 				EE_Error::add_error(
907
-						__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
907
+						__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
908 908
 						__FILE__, __FUNCTION__, __LINE__
909 909
 				);
910 910
 			}
@@ -924,38 +924,38 @@  discard block
 block discarded – undo
924 924
 	 */
925 925
 	protected function refresh_entity_map() {
926 926
 		// verify the transaction
927
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
927
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
928 928
 			// never cache payment info
929
-			$this->transaction->clear_cache( 'Payment' );
929
+			$this->transaction->clear_cache('Payment');
930 930
 			/** @type EE_Transaction_Processor $transaction_processor */
931
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
931
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
932 932
 			// is the Payment Options Reg Step completed ?
933
-			if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) {
933
+			if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) {
934 934
 				// then check for payments and update TXN accordingly
935 935
 				/** @type EE_Transaction_Payments $transaction_payments */
936
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
937
-				$transaction_payments->calculate_total_payments_and_update_status( $this->transaction );
936
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
937
+				$transaction_payments->calculate_total_payments_and_update_status($this->transaction);
938 938
 			}
939 939
 			// grab the saved registrations from the transaction
940
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration ) {
941
-				$this->_refresh_registration( $reg_cache_ID, $registration );
940
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration) {
941
+				$this->_refresh_registration($reg_cache_ID, $registration);
942 942
 			}
943 943
 			// make sure our cached TXN is added to the model entity mapper
944
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction );
944
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction);
945 945
 
946 946
 		} else {
947
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
947
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
948 948
 			return FALSE;
949 949
 		}
950
-		if ( $this->cart instanceof EE_Cart ) {
950
+		if ($this->cart instanceof EE_Cart) {
951 951
 			$grand_total = $this->cart->get_grand_total()->get_model()->refresh_entity_map_with(
952 952
 				$this->cart->get_grand_total()->ID(),
953 953
 				$this->cart->get_grand_total()
954 954
 			);
955
-			if ( $grand_total instanceof EE_Line_Item ) {
956
-				$this->cart = EE_Cart::instance( $grand_total );
955
+			if ($grand_total instanceof EE_Line_Item) {
956
+				$this->cart = EE_Cart::instance($grand_total);
957 957
 			} else {
958
-				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
958
+				EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
959 959
 				return false;
960 960
 			}
961 961
 		}
@@ -971,19 +971,19 @@  discard block
 block discarded – undo
971 971
 	 * @param 	EE_Registration 	$registration
972 972
 	 * @return void
973 973
 	 */
974
-	protected function _refresh_registration( $reg_cache_ID, $registration ) {
974
+	protected function _refresh_registration($reg_cache_ID, $registration) {
975 975
 
976 976
 		// verify object
977
-		if ( $registration instanceof EE_Registration ) {
977
+		if ($registration instanceof EE_Registration) {
978 978
 			// update the entity mapper attendee
979
-			$this->_refresh_registration_attendee( $registration );
979
+			$this->_refresh_registration_attendee($registration);
980 980
 			// update the entity mapper answers for reg form questions
981
-			$this->_refresh_registration_answers( $registration );
981
+			$this->_refresh_registration_answers($registration);
982 982
 			// make sure the cached registration is added to the model entity mapper
983
-			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
983
+			$registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration);
984 984
 		} else {
985 985
 			EE_Error::add_error(
986
-				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
986
+				__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
987 987
 				__FILE__, __FUNCTION__, __LINE__
988 988
 			);
989 989
 		}
@@ -997,15 +997,15 @@  discard block
 block discarded – undo
997 997
 	 * @param 	EE_Registration 	$registration
998 998
 	 * @return void
999 999
 	 */
1000
-	protected function _refresh_registration_attendee( $registration ) {
1000
+	protected function _refresh_registration_attendee($registration) {
1001 1001
 
1002 1002
 		$attendee = $registration->attendee();
1003 1003
 		// verify object
1004
-		if ( $attendee instanceof EE_Attendee && $attendee->ID() ) {
1004
+		if ($attendee instanceof EE_Attendee && $attendee->ID()) {
1005 1005
 			// make sure the cached attendee is added to the model entity mapper
1006
-			$registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee );
1006
+			$registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee);
1007 1007
 			// maybe cache primary_attendee_obj ?
1008
-			if ( $registration->is_primary_registrant() ) {
1008
+			if ($registration->is_primary_registrant()) {
1009 1009
 				$this->primary_attendee_obj = $attendee;
1010 1010
 			}
1011 1011
 		}
@@ -1019,19 +1019,19 @@  discard block
 block discarded – undo
1019 1019
 	 * @param 	EE_Registration 	$registration
1020 1020
 	 * @return void
1021 1021
 	 */
1022
-	protected function _refresh_registration_answers( $registration ) {
1022
+	protected function _refresh_registration_answers($registration) {
1023 1023
 
1024 1024
 		// now update the answers
1025
-		foreach ( $registration->answers() as $cache_key => $answer ) {
1025
+		foreach ($registration->answers() as $cache_key => $answer) {
1026 1026
 			// verify object
1027
-			if ( $answer instanceof EE_Answer ) {
1028
-				if ( $answer->ID() ) {
1027
+			if ($answer instanceof EE_Answer) {
1028
+				if ($answer->ID()) {
1029 1029
 					// make sure the cached answer is added to the model entity mapper
1030
-					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1030
+					$answer->get_model()->refresh_entity_map_with($answer->ID(), $answer);
1031 1031
 				}
1032 1032
 			} else {
1033 1033
 				EE_Error::add_error(
1034
-					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1034
+					__('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1035 1035
 					__FILE__, __FUNCTION__, __LINE__
1036 1036
 				);
1037 1037
 			}
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 	 * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object
1047 1047
 	 */
1048 1048
 	function __wakeup() {
1049
-		foreach ( $this->reg_steps as $reg_step ) {
1049
+		foreach ($this->reg_steps as $reg_step) {
1050 1050
 			$reg_step->checkout = $this;
1051 1051
 		}
1052 1052
 	}
@@ -1062,11 +1062,11 @@  discard block
 block discarded – undo
1062 1062
 	 * @param array $info
1063 1063
 	 * @param bool $display_request
1064 1064
 	 */
1065
-	function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) {
1066
-		if ( WP_DEBUG && false ) {
1067
-			$debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() );
1065
+	function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) {
1066
+		if (WP_DEBUG && false) {
1067
+			$debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array());
1068 1068
 			$default_data = array(
1069
-				$class 		=> $func . '() : ' . $line,
1069
+				$class 		=> $func.'() : '.$line,
1070 1070
 				'request->step' 		=> $this->step,
1071 1071
 				'request->action' 	=> $this->action,
1072 1072
 				'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ?
@@ -1078,24 +1078,24 @@  discard block
 block discarded – undo
1078 1078
 				'reg_url_link' => $this->reg_url_link,
1079 1079
 				'REQ' => $display_request ? $_REQUEST : '',
1080 1080
 			);
1081
-			if ( $this->transaction instanceof EE_Transaction ) {
1082
-				$default_data[ 'TXN_status' ] 		= $this->transaction->status_ID();
1083
-				$default_data[ 'TXN_reg_steps' ] 	= $this->transaction->reg_steps();
1084
-				foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) {
1085
-					$default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID();
1081
+			if ($this->transaction instanceof EE_Transaction) {
1082
+				$default_data['TXN_status'] = $this->transaction->status_ID();
1083
+				$default_data['TXN_reg_steps'] = $this->transaction->reg_steps();
1084
+				foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) {
1085
+					$default_data['registrations'][$REG_ID] = $registration->status_ID();
1086 1086
 				}
1087
-				if ( $this->transaction->ID() ) {
1088
-					$TXN_ID = 'EE_Transaction: ' . $this->transaction->ID();
1087
+				if ($this->transaction->ID()) {
1088
+					$TXN_ID = 'EE_Transaction: '.$this->transaction->ID();
1089 1089
 					// don't serialize objects
1090
-					$info = $this->_strip_objects( $info );
1091
-					if ( ! isset( $debug_data[ $TXN_ID ] ) ) {
1092
-						$debug_data[ $TXN_ID ] = array();
1090
+					$info = $this->_strip_objects($info);
1091
+					if ( ! isset($debug_data[$TXN_ID])) {
1092
+						$debug_data[$TXN_ID] = array();
1093 1093
 					}
1094
-					$debug_data[ $TXN_ID ][ microtime() ] = array_merge(
1094
+					$debug_data[$TXN_ID][microtime()] = array_merge(
1095 1095
 						$default_data,
1096 1096
 						$info
1097 1097
 					);
1098
-					update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data );
1098
+					update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data);
1099 1099
 				}
1100 1100
 			}
1101 1101
 		}
@@ -1108,23 +1108,23 @@  discard block
 block discarded – undo
1108 1108
 	 * @param array $info
1109 1109
 	 * @return array
1110 1110
 	 */
1111
-	function _strip_objects( $info = array() ) {
1112
-		foreach ( $info as $key => $value ) {
1113
-			if ( is_array( $value )) {
1114
-				$info[ $key ] = $this->_strip_objects( $value );
1115
-			} else if ( is_object( $value ) ) {
1116
-				$object_class = get_class( $value );
1117
-				$info[ $object_class ] = array();
1118
-				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1119
-				if ( method_exists( $value, 'status' ) ) {
1120
-					$info[ $object_class ][ 'status' ] = $value->status();
1121
-				} else if ( method_exists( $value, 'status_ID' ) ) {
1122
-					$info[ $object_class ][ 'status' ] = $value->status_ID();
1111
+	function _strip_objects($info = array()) {
1112
+		foreach ($info as $key => $value) {
1113
+			if (is_array($value)) {
1114
+				$info[$key] = $this->_strip_objects($value);
1115
+			} else if (is_object($value)) {
1116
+				$object_class = get_class($value);
1117
+				$info[$object_class] = array();
1118
+				$info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0;
1119
+				if (method_exists($value, 'status')) {
1120
+					$info[$object_class]['status'] = $value->status();
1121
+				} else if (method_exists($value, 'status_ID')) {
1122
+					$info[$object_class]['status'] = $value->status_ID();
1123 1123
 				}
1124
-				unset( $info[ $key ] );
1124
+				unset($info[$key]);
1125 1125
 			}
1126 1126
 		}
1127
-		return (array)$info;
1127
+		return (array) $info;
1128 1128
 	}
1129 1129
 
1130 1130
 
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_SPCO_JSON_Response.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_JSON_Response
5
- *
6
- * Description
7
- *
8
- * @package         Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since		 	   $VID:$
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_JSON_Response
5
+  *
6
+  * Description
7
+  *
8
+  * @package         Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since		 	   $VID:$
12
+  *
13
+  */
14 14
 class EE_SPCO_JSON_Response {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -97,64 +97,64 @@  discard block
 block discarded – undo
97 97
 	public function __toString() {
98 98
 		$JSON_response = array();
99 99
 		// grab notices
100
-		$notices = EE_Error::get_notices( FALSE );
101
-		$this->set_attention( isset( $notices['attention'] ) ? $notices['attention'] : '' );
102
-		$this->set_errors( isset( $notices['errors'] ) ? $notices['errors'] : '' );
103
-		$this->set_success( isset( $notices['success'] ) ? $notices['success'] : '' );
100
+		$notices = EE_Error::get_notices(FALSE);
101
+		$this->set_attention(isset($notices['attention']) ? $notices['attention'] : '');
102
+		$this->set_errors(isset($notices['errors']) ? $notices['errors'] : '');
103
+		$this->set_success(isset($notices['success']) ? $notices['success'] : '');
104 104
 		// add notices to JSON response, but only if they exist
105
-		if ( $this->attention() ) {
105
+		if ($this->attention()) {
106 106
 			$JSON_response['attention'] = $this->attention();
107 107
 		}
108
-		if ( $this->errors() ) {
108
+		if ($this->errors()) {
109 109
 			$JSON_response['errors'] = $this->errors();
110 110
 		}
111
-		if ( $this->success() ) {
111
+		if ($this->success()) {
112 112
 			$JSON_response['success'] = $this->success();
113 113
 		}
114 114
 		// but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked
115
-		if ( ! isset( $JSON_response[ 'attention' ] ) && ! isset( $JSON_response[ 'errors' ] ) && ! isset( $JSON_response[ 'success' ] ) ) {
115
+		if ( ! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) {
116 116
 			$JSON_response['success'] = null;
117 117
 		}
118 118
 		// set redirect_url, IF it exists
119
-		if ( $this->redirect_url() ) {
119
+		if ($this->redirect_url()) {
120 120
 			$JSON_response['redirect_url'] = $this->redirect_url();
121 121
 		}
122 122
 		// set registration_time_limit, IF it exists
123
-		if ( $this->registration_time_limit() ) {
123
+		if ($this->registration_time_limit()) {
124 124
 			$JSON_response['registration_time_limit'] = $this->registration_time_limit();
125 125
 		}
126 126
 		// grab generic return data
127 127
 		$return_data = $this->return_data();
128 128
 		// add billing form validation rules
129
-		if ( $this->validation_rules() ) {
129
+		if ($this->validation_rules()) {
130 130
 			$return_data['validation_rules'] = $this->validation_rules();
131 131
 		}
132 132
 		// set reg_step_html, IF it exists
133
-		if ( $this->reg_step_html() ) {
133
+		if ($this->reg_step_html()) {
134 134
 			$return_data['reg_step_html'] = $this->reg_step_html();
135 135
 		}
136 136
 		// set method of payment, IF it exists
137
-		if ( $this->method_of_payment() ) {
137
+		if ($this->method_of_payment()) {
138 138
 			$return_data['method_of_payment'] = $this->method_of_payment();
139 139
 		}
140 140
 		// set "plz_select_method_of_payment" message, IF it exists
141
-		if ( $this->plz_select_method_of_payment() ) {
141
+		if ($this->plz_select_method_of_payment()) {
142 142
 			$return_data['plz_select_method_of_payment'] = $this->plz_select_method_of_payment();
143 143
 		}
144 144
 		// set redirect_form, IF it exists
145
-		if ( $this->redirect_form() ) {
145
+		if ($this->redirect_form()) {
146 146
 			$return_data['redirect_form'] = $this->redirect_form();
147 147
 		}
148 148
 		// and finally, add return_data array to main JSON response array, IF it contains anything
149 149
 		// why did we add some of the above properties to the return data array?
150 150
 		// because it is easier and cleaner in the Javascript to deal with this way
151
-		if ( ! empty( $return_data )) {
151
+		if ( ! empty($return_data)) {
152 152
 			$JSON_response['return_data'] = $return_data;
153 153
 		}
154 154
 		// filter final array
155
-		$JSON_response = apply_filters( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response );
155
+		$JSON_response = apply_filters('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response);
156 156
 		// return encoded array
157
-		return json_encode( $JSON_response );
157
+		return json_encode($JSON_response);
158 158
 	}
159 159
 
160 160
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	/**
163 163
 	 * @param string $attention
164 164
 	 */
165
-	public function set_attention( $attention ) {
165
+	public function set_attention($attention) {
166 166
 		$this->_attention = $attention;
167 167
 	}
168 168
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	/**
181 181
 	 * @param string $errors
182 182
 	 */
183
-	public function set_errors( $errors ) {
183
+	public function set_errors($errors) {
184 184
 		$this->_errors = $errors;
185 185
 	}
186 186
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	/**
199 199
 	 * @param string $success
200 200
 	 */
201
-	public function set_success( $success ) {
201
+	public function set_success($success) {
202 202
 		$this->_success = $success;
203 203
 	}
204 204
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	/**
217 217
 	 * @param string $method_of_payment
218 218
 	 */
219
-	public function set_method_of_payment( $method_of_payment ) {
219
+	public function set_method_of_payment($method_of_payment) {
220 220
 		$this->_method_of_payment = $method_of_payment;
221 221
 	}
222 222
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	/**
235 235
 	 * @param string $next_step_html
236 236
 	 */
237
-	public function set_reg_step_html( $next_step_html ) {
237
+	public function set_reg_step_html($next_step_html) {
238 238
 		$this->_reg_step_html = $next_step_html;
239 239
 	}
240 240
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	/**
253 253
 	 * @param string $redirect_form
254 254
 	 */
255
-	public function set_redirect_form( $redirect_form ) {
255
+	public function set_redirect_form($redirect_form) {
256 256
 		$this->_redirect_form = $redirect_form;
257 257
 	}
258 258
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @return string
263 263
 	 */
264 264
 	public function redirect_form() {
265
-		return ! empty( $this->_redirect_form ) ? $this->_redirect_form : FALSE;
265
+		return ! empty($this->_redirect_form) ? $this->_redirect_form : FALSE;
266 266
 	}
267 267
 
268 268
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	/**
271 271
 	 * @param string $plz_select_method_of_payment
272 272
 	 */
273
-	public function set_plz_select_method_of_payment( $plz_select_method_of_payment ) {
273
+	public function set_plz_select_method_of_payment($plz_select_method_of_payment) {
274 274
 		$this->_plz_select_method_of_payment = $plz_select_method_of_payment;
275 275
 	}
276 276
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	/**
289 289
 	 * @param string $redirect_url
290 290
 	 */
291
-	public function set_redirect_url( $redirect_url ) {
291
+	public function set_redirect_url($redirect_url) {
292 292
 		$this->_redirect_url = $redirect_url;
293 293
 	}
294 294
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	/**
316 316
 	 * @param string $registration_time_limit
317 317
 	 */
318
-	public function set_registration_time_limit( $registration_time_limit ) {
318
+	public function set_registration_time_limit($registration_time_limit) {
319 319
 		$this->_registration_time_limit = $registration_time_limit;
320 320
 	}
321 321
 
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 	/**
325 325
 	 * @param array $return_data
326 326
 	 */
327
-	public function set_return_data( $return_data ) {
328
-		$this->_return_data = array_merge( $this->_return_data, $return_data );
327
+	public function set_return_data($return_data) {
328
+		$this->_return_data = array_merge($this->_return_data, $return_data);
329 329
 	}
330 330
 
331 331
 
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
 	/**
343 343
 	 * @param array $validation_rules
344 344
 	 */
345
-	public function add_validation_rules( $validation_rules = array() ) {
346
-		if ( is_array( $validation_rules ) && ! empty( $validation_rules )) {
347
-			$this->_validation_rules = array_merge( $this->_validation_rules, $validation_rules );
345
+	public function add_validation_rules($validation_rules = array()) {
346
+		if (is_array($validation_rules) && ! empty($validation_rules)) {
347
+			$this->_validation_rules = array_merge($this->_validation_rules, $validation_rules);
348 348
 		}
349 349
 	}
350 350
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	 * @return array | bool
355 355
 	 */
356 356
 	public function validation_rules() {
357
-		return ! empty( $this->_validation_rules ) ? $this->_validation_rules : FALSE;
357
+		return ! empty($this->_validation_rules) ? $this->_validation_rules : FALSE;
358 358
 	}
359 359
 
360 360
 
Please login to merge, or discard this patch.
inc/EE_SPCO_Reg_Step_Registration_Confirmation.class.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_Reg_Step_Registration_Confirmation
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage 	core
10
- * @author 				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_Reg_Step_Registration_Confirmation
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage 	core
10
+  * @author 				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_SPCO_Reg_Step_Registration_Confirmation extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 * @param    EE_Checkout $checkout
21 21
 	 * @return 	\EE_SPCO_Reg_Step_Registration_Confirmation
22 22
 	 */
23
-	public function __construct( EE_Checkout $checkout ) {
23
+	public function __construct(EE_Checkout $checkout) {
24 24
 		$this->_slug = 'registration_confirmation';
25 25
 		$this->_name = __('Registration Confirmation', 'event_espresso');
26
-		$this->_template = SPCO_TEMPLATES_PATH . 'registration_page_confirmation.template.php';
26
+		$this->_template = SPCO_TEMPLATES_PATH.'registration_page_confirmation.template.php';
27 27
 		$this->checkout = $checkout;
28 28
 	}
29 29
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @return string
50 50
 	 */
51 51
 	public function generate_reg_form() {
52
-		EE_Registry::instance()->REQ->add_output( 'generate_reg_form' );
52
+		EE_Registry::instance()->REQ->add_output('generate_reg_form');
53 53
 	}
54 54
 
55 55
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
 
40 40
 	/**
41
-	 * @return boolean
41
+	 * @return boolean|null
42 42
 	 */
43 43
 	public function initialize_reg_step() {
44 44
 	}
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_selector_chart_iframe.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
 <html>
17 17
 <head>
18 18
 	<title><?php _e('Ticket Selector', 'event_espresso'); ?></title>
19
-	<?php foreach ( $css as $url ) : ?>
20
-		<link rel="stylesheet" type="text/css" href="<?php echo $url;?>">
19
+	<?php foreach ($css as $url) : ?>
20
+		<link rel="stylesheet" type="text/css" href="<?php echo $url; ?>">
21 21
 	<?php endforeach; ?>
22
-	<?php foreach ( $js as $jsurl ) : ?>
22
+	<?php foreach ($js as $jsurl) : ?>
23 23
 		<script type="text/javascript" src="<?php echo $jsurl; ?>"></script>
24 24
 	<?php endforeach; ?>
25 25
 </head>
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	<?php echo $ticket_selector; ?>
28 28
 	<script type="text/javascript">
29 29
 		var EEDTicketSelectorMsg = {
30
-			zeroSelected : '<?php _e('Please choose at least one ticket before continuing.', 'event_espresso' ); ?>'
30
+			zeroSelected : '<?php _e('Please choose at least one ticket before continuing.', 'event_espresso'); ?>'
31 31
 		}
32 32
 	</script>
33 33
 </body>
Please login to merge, or discard this patch.
modules/venues_archive/EED_Venues_Archive.module.php 3 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venues_Archive
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venues', 'Venues_Archive', 'run' );
40
+		EE_Config::register_route('venues', 'Venues_Archive', 'run');
41 41
 //		EE_Config::register_view( 'venues', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 *  @access 	public
59 59
 	 *  @return 	void
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -72,20 +72,20 @@  discard block
 block discarded – undo
72 72
 	 *  	@access 	public
73 73
 	 *  	@return 	void
74 74
 	 */
75
-	public function template_include( $template ) {
75
+	public function template_include($template) {
76 76
 		// not a custom template?
77
-		if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_venues.php' ) {
77
+		if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_venues.php') {
78 78
 			EEH_Template::load_espresso_theme_functions();
79 79
 			// then add extra event data via hooks
80
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 2 );
80
+			add_filter('the_title', array($this, 'the_title'), 100, 2);
81 81
 			// don't know if theme uses the_excerpt
82
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
83
-			add_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
82
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
83
+			add_filter('the_excerpt', array($this, 'venue_location'), 110);
84 84
 			// or the_content
85
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
86
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
85
+			add_filter('the_content', array($this, 'venue_details'), 100);
86
+			add_filter('the_content', array($this, 'venue_location'), 110);
87 87
 			// don't diplay entry meta because the existing theme will take car of that
88
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
88
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
89 89
 		}
90 90
 		return $template;
91 91
 	}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * 	@param		string 	$title
100 100
 	 *  	@return 		void
101 101
 	 */
102
-	public function the_title( $title = '', $id = '' ) {
102
+	public function the_title($title = '', $id = '') {
103 103
 		return $title;
104 104
 //		global $post;
105 105
 //		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title :  $title;
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
 	 * 	@param		string 	$content
114 114
 	 *  	@return 		void
115 115
 	 */
116
-	public function venue_details( $content ) {
116
+	public function venue_details($content) {
117 117
 		global $post;
118 118
 		// since the 'content-espresso_venues-details.php' template might be used directly from within a theme,
119 119
 		// it uses the_content() for displaying the $post->post_content
120 120
 		// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
121 121
 		// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
122
-		remove_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
123
-		remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
122
+		remove_filter('the_excerpt', array($this, 'venue_details'), 100);
123
+		remove_filter('the_content', array($this, 'venue_details'), 100);
124 124
 		// now load our template
125
-		$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
125
+		$template = EEH_Template::locate_template('content-espresso_venues-details.php');
126 126
 		//now add our filter back in, plus some others
127
-		add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
128
-		add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
127
+		add_filter('the_excerpt', array($this, 'venue_details'), 100);
128
+		add_filter('the_content', array($this, 'venue_details'), 100);
129 129
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
130
-		return ! empty( $template ) ? $template : $content;
130
+		return ! empty($template) ? $template : $content;
131 131
 	}
132 132
 
133 133
 
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 	 * 	@param		string 	$content
140 140
 	 *  	@return 		void
141 141
 	 */
142
-	public function venue_location( $content ) {
143
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
142
+	public function venue_location($content) {
143
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
144 144
 	}
145 145
 
146 146
 
@@ -154,19 +154,19 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public function wp_enqueue_scripts() {
156 156
 		// get some style
157
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_archive() ) {
157
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_archive()) {
158 158
 			// first check theme folder
159
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
160
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
161
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
162
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
159
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
160
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
161
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
162
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
163 163
 			}
164 164
 //			if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.js' )) {
165 165
 //				wp_register_script( 'archive-espresso_venues', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.js', array('espresso_core'), '1.0', TRUE  );
166 166
 //			} else if ( is_readable( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.js' )) {
167 167
 //				wp_register_script( 'archive-espresso_venues', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.js', array('espresso_core'), '1.0', TRUE );
168 168
 //			}
169
-			wp_enqueue_style( $this->theme );
169
+			wp_enqueue_style($this->theme);
170 170
 //			wp_enqueue_script( 'archive-espresso_venues' );
171 171
 
172 172
 		}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 *
94 94
 	 *  	@access 	public
95 95
 	 * 	@param		string 	$title
96
-	 *  	@return 		void
96
+	 *  	@return 		string
97 97
 	 */
98 98
 	public function the_title( $title = '', $id = '' ) {
99 99
 		return $title;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 *
130 130
 	 *  	@access 	public
131 131
 	 * 	@param		string 	$content
132
-	 *  	@return 		void
132
+	 *  	@return 		string
133 133
 	 */
134 134
 	public function venue_location( $content ) {
135 135
 		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
Please login to merge, or discard this patch.
modules/zzz-copy-this-module-template/EED_.module.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	 *  @access 	public
51 51
 	 *  @return 	void
52 52
 	 */
53
-	public function run( $WP ) {
53
+	public function run($WP) {
54 54
 //		add_filter( 'FHEE_load_ee_config', '__return_true' );
55 55
 //		add_filter( 'FHEE_run_EE_wp', '__return_true' );
56 56
 //		add_filter( 'FHEE_load_EE_Session', '__return_true' );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
payment_methods/Admin_Only/EE_PMT_Admin_Only.pm.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@
 block discarded – undo
2 2
 if (!defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5
- *
6
- * EE_PMT_Admin_Only.
7
- * These payment methods really shouldn't be shown on frontend and contain nearly no functionality.
8
- * They should just be used admin-side for recording payments like Cash, Check, etc.
9
- *
10
- * @package			Event Espresso
11
- * @subpackage
12
- * @author				Mike Nelson
13
- *
14
- */
5
+	 *
6
+	 * EE_PMT_Admin_Only.
7
+	 * These payment methods really shouldn't be shown on frontend and contain nearly no functionality.
8
+	 * They should just be used admin-side for recording payments like Cash, Check, etc.
9
+	 *
10
+	 * @package			Event Espresso
11
+	 * @subpackage
12
+	 * @author				Mike Nelson
13
+	 *
14
+	 */
15 15
 class EE_PMT_Admin_Only extends EE_PMT_Base{
16 16
 
17 17
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5 5
  *
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @author				Mike Nelson
13 13
  *
14 14
  */
15
-class EE_PMT_Admin_Only extends EE_PMT_Base{
15
+class EE_PMT_Admin_Only extends EE_PMT_Base {
16 16
 
17 17
 
18 18
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param \EE_Transaction $transaction
35 35
 	 * @return NULL
36 36
 	 */
37
-	public function generate_new_billing_form( EE_Transaction $transaction = NULL ) {
37
+	public function generate_new_billing_form(EE_Transaction $transaction = NULL) {
38 38
 		return NULL;
39 39
 	}
40 40
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 /**
5 6
  *
6 7
  * EE_PMT_Admin_Only.
Please login to merge, or discard this patch.
payment_methods/Bank/templates/bank_payment_details_content.template.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,27 +3,27 @@
 block discarded – undo
3 3
 if (!defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 /**
6
- * Event Espresso
7
- *
8
- * Event Registration and Management Plugin for WordPress
9
- *
10
- * @ package			Event Espresso
11
- * @ author			Seth Shoultes
12
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
13
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
- * @ link					http://www.eventespresso.com
15
- * @ version		 	4.3
16
- *
17
- * ------------------------------------------------------------------------
18
- *
19
- * bank_payment_overview_content
20
- *
21
- * @package			Event Espresso
22
- * @subpackage
23
- * @author				Mike Nelson
24
- *
25
- * ------------------------------------------------------------------------
26
- */
6
+	 * Event Espresso
7
+	 *
8
+	 * Event Registration and Management Plugin for WordPress
9
+	 *
10
+	 * @ package			Event Espresso
11
+	 * @ author			Seth Shoultes
12
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
13
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
+	 * @ link					http://www.eventespresso.com
15
+	 * @ version		 	4.3
16
+	 *
17
+	 * ------------------------------------------------------------------------
18
+	 *
19
+	 * bank_payment_overview_content
20
+	 *
21
+	 * @package			Event Espresso
22
+	 * @subpackage
23
+	 * @author				Mike Nelson
24
+	 *
25
+	 * ------------------------------------------------------------------------
26
+	 */
27 27
 ?><div class="event-display-boxes">
28 28
 			<h4 id="page_title" class="payment_type_title section-heading"><?php echo $page_title ?></h4>
29 29
 				<p class="instruct"><?php echo wpautop( $payment_instructions ) ?></p>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 /**
6 6
  * Event Espresso
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?><div class="event-display-boxes">
28 28
 			<h4 id="page_title" class="payment_type_title section-heading"><?php echo $page_title ?></h4>
29
-				<p class="instruct"><?php echo wpautop( $payment_instructions ) ?></p>
29
+				<p class="instruct"><?php echo wpautop($payment_instructions) ?></p>
30 30
 		</div>
31 31
 <?php
32 32
 // End of file bank_payment_overview_content.template.php
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.